How to use the nativescript-angular/application.nativeScriptBootstrap function in nativescript-angular

To help you get started, we’ve selected a few nativescript-angular 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 matt4446 / WhatsMyScore2-NativeScript / app / decorators / app.ts View on Github external
NS_ROUTER_PROVIDERS
        ];

        config.providers = config.providers 
            ? config.providers.concat(baseConfig) 
            : [baseConfig];

        config.directives = config.directives 
            ? config.directives.concat(NS_ROUTER_DIRECTIVES) 
            : [NS_ROUTER_DIRECTIVES];

        annotations.push(new Component(config));

        _reflect.defineMetadata('annotations', annotations, startingComponent);
        
        nativeScriptBootstrap(startingComponent, config.providers, config.appOptions).then((appRef) => {
            registerElements.forEach(element => {
                // let injector = appRef.injector;
                // let page: Page = injector.get(Page);
                
                console.log("Add element: " + element.name);
                registerElement(element.name, element.resolver)
            }); 
            
            // if(config.appStartup){
            //     config.appStartup(appRef);
            // }
        });
        
        return startingComponent;
    }
}
github triniwiz / horizon-nativescript-chat-app / app / main.ts View on Github external
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import {nativeScriptBootstrap} from "nativescript-angular/application";
import {HTTP_PROVIDERS} from '@angular/http';
require('nativescript-websockets'); // VERY IMPORTANT this comes BEFORE import of root component below!
import {AppComponent} from "./app.component";

nativeScriptBootstrap(AppComponent, [HTTP_PROVIDERS]);
github eeandrew / NSCalculator / app / main.js View on Github external
"use strict";
// this import should be first in order to load some required settings (like globals and reflect-metadata)
var application_1 = require("nativescript-angular/application");
var app_component_1 = require("./app.component");
application_1.nativeScriptBootstrap(app_component_1.AppComponent, [], { startPageActionBarHidden: true });
//# sourceMappingURL=main.js.map
github Appverse / Nativescript-NG2-Showcase / app / main.ts View on Github external
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import {nativeScriptBootstrap} from "nativescript-angular/application";
import { CHART_PROVIDERS } from 'nativescript-telerik-ui-pro/chart/angular';
import {AppComponent} from "./app.component";

nativeScriptBootstrap(AppComponent, [CHART_PROVIDERS]);
github burkeholland / nativescript-todo-angular / app / main.ts View on Github external
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import {nativeScriptBootstrap} from "nativescript-angular/application";
import * as appSettings from "application-settings";
import {TodoApp} from "./app.component";

/* Before we bootstrap, shim the 'localStorage' API with application settings module */
global.localStorage = {
    getItem(key: string) {
        return appSettings.getString(key);
    },
    setItem(key: string, value: string) {
        return appSettings.setString(key, value); 
    }
}

nativeScriptBootstrap(TodoApp);
github eeandrew / NSCalculator / app / main.ts View on Github external
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import {nativeScriptBootstrap} from "nativescript-angular/application";
import {AppComponent} from "./app.component";

nativeScriptBootstrap(AppComponent,[],{startPageActionBarHidden:true});
github matt4446 / WhatsMyScore2-NativeScript / app / mainPage.ts View on Github external
export function pageLoadedBindAngular(args) {
    var page = args.object;
    page.bindingContext = "";

    if(!bootstrapPromise){
        console.log('BOOTSTRAPPING...');
        var promise = nativeScriptBootstrap(MainPage, [
            ROUTER_PROVIDERS,
            bind(LocationStrategy).toClass(NSLocationStrategy), //https://github.com/NativeScript/sample-Groceries/blob/710de30fdfe8640cabb489fb64ac02c1af894926/app/app-page.ts
            provide(APP_BASE_HREF, {useValue : '/'})
        ]);
    }
    
    bootstrapPromise = promise
}
github JoshDSommer / nativescript-ngx-parallax / src / app / app.ts View on Github external
#titleLabel{
			font-weight:bold;
			font-size:30;
			padding:5 15;

		}
`]

})
class DemoComponent {
	public message: string = "Your {N} + Angular 2 plugin is working."

	constructor() { }
}

nativeScriptBootstrap(DemoComponent, []);
github bradmartin / nativescript-drawingpad / demo-angular / main.ts View on Github external
import { nativeScriptBootstrap } from 'nativescript-angular/application';
import { App } from './App';

nativeScriptBootstrap(App);
github NativeScript / sample-Groceries / app / main.ts View on Github external
import {nativeScriptBootstrap} from "nativescript-angular/application";
import {AppComponent} from "./app.component";
import {setStatusBarColors} from "./utils/status-bar-util";

setStatusBarColors();
nativeScriptBootstrap(AppComponent);