How to use the @angular/platform-browser.platformBrowser function in @angular/platform-browser

To help you get started, we’ve selected a few @angular/platform-browser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github projectSHAI / GOATstack / client / main-aot.ts View on Github external
//The browser platform with a compiler, used for Just in Time loading.
//JIT means Angular compiles the application in the browser and then launches the app
import { platformBrowser } from '@angular/platform-browser';

//imports the AppModule which is the root module that bootstraps app.component.ts
import { MainModuleNgFactory } from '../ngc-aot/client/main.module.ngfactory';
import { enableProdMode } from '@angular/core';
enableProdMode();

// Compile and launch the module
platformBrowser().bootstrapModuleFactory(MainModuleNgFactory);
github angular / angular / aio / content / examples / upgrade-phonecat-2-hybrid / app / main-aot.ts View on Github external
// #docregion
import { platformBrowser } from '@angular/platform-browser';

import { AppModuleNgFactory } from './app.module.ngfactory';

platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
github Ks89 / angular-webpack-skeleton / src / admin.aot.ts View on Github external
export function main(): any {
  return platformBrowser()
    .bootstrapModuleFactory(AdminModuleNgFactory)
    .then(decorateModuleRef)
    .catch((err: any) => console.error(err));
}
github patrickmichalina / fusing-angular / src / electron / angular / main.aot.ts View on Github external
document.addEventListener('DOMContentLoaded', () => {
  platformBrowser()
    .bootstrapModule(AppElectronModule)
    .catch(console.log)
})
github angular / angular / modules / benchmarks / src / tree / ng2_static_ftl / index.ts View on Github external
function init() {
    enableProdMode();
    platformBrowser().bootstrapModuleFactory(AppModuleNgFactory).then((ref) => {
      const injector = ref.injector;
      appRef = injector.get(ApplicationRef);

      tree = appRef.components[0].instance;
      bindAction('#destroyDom', destroyDom);
      bindAction('#createDom', createDom);
      bindAction('#updateDomProfile', profile(createDom, noop, 'update'));
      bindAction('#createDomProfile', profile(createDom, destroyDom, 'create'));
    });
  }
github jhipster / jhipster-online / src / main / webapp / app / app.main-aot.ts View on Github external
*
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { platformBrowser } from '@angular/platform-browser';
import { ProdConfig } from './blocks/config/prod.config';
import { JhonlineAppModuleNgFactory } from '../../../../target/aot/src/main/webapp/app/app.module.ngfactory';

ProdConfig();

platformBrowser().bootstrapModuleFactory(JhonlineAppModuleNgFactory)
.then((success) => console.log(`Application started`))
.catch((err) => console.error(err));
github opendigitaleducation / entcore / admin / src / main / ts / main.aot.ts View on Github external
import { platformBrowser }      from '@angular/platform-browser'
import { enableProdMode }       from '@angular/core'
import { AppModuleNgFactory }   from './aot/app/app.module.ngfactory'

if (process.env.ENV === 'production') {
    enableProdMode()
}

platformBrowser().bootstrapModuleFactory(AppModuleNgFactory)
github ionic-team / ionic-site / content / docs / demos / src / button / entry.js View on Github external
import { platformBrowser } from '@angular/platform-browser';
import { enableProdMode } from '@angular/core';
import { AppModuleNgFactory } from './app.module.ngfactory';
enableProdMode();
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
//# sourceMappingURL=entry.js.map
github blackbaud / skyux-builder / src / main-internal.aot.ts View on Github external
SkyAppBootstrapper.processBootstrapConfig().then(() => {
  platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
});
github angular / angular / modules / benchmarks / src / largetable / ng2 / index_aot.ts View on Github external
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {enableProdMode} from '@angular/core';
import {platformBrowser} from '@angular/platform-browser';

import {init} from './init';
import {AppModuleNgFactory} from './table.ngfactory';

enableProdMode();
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory).then(init);