How to use nativescript-angular - 10 common examples

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 NativeScript / nativescript-angular / e2e / tests-app-ng / app / lazy / lazy.module.ts View on Github external
export function modalParamsFactory() {
    return new ModalDialogParams({}, null);
}

const routes: Routes = [
  {
    path: "",
    component: LazyComponent
  }
];

@NgModule({
  imports: [
    NativeScriptCommonModule,
    NativeScriptRouterModule.forChild(routes),
  ],
  declarations: [
    LazyComponent
  ],
  entryComponents: [
    LazyComponent
  ],
  providers: [
    // allows same component to be routed to
    // or lazily loaded via modal
    { provide: ModalDialogParams, useFactory: modalParamsFactory }
  ],
  schemas: [NO_ERRORS_SCHEMA]
})
export class LazyModule { }
github matt4446 / WhatsMyScore2-NativeScript / app / decorators / app.ts View on Github external
registerElements.forEach(element => {
                // let injector = appRef.injector;
                // let page: Page = injector.get(Page);
                
                console.log("Add element: " + element.name);
                registerElement(element.name, element.resolver)
            });
github chronogolf / nativescript-store-update / demo-angular / app / main.aot.ts View on Github external
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import { platformNativeScript } from 'nativescript-angular/platform-static'
import { StoreUpdate } from 'nativescript-store-update'
import { AppModuleNgFactory } from './app.module.ngfactory'

StoreUpdate.init({
  notifyNbDaysAfterRelease: 1,
})
platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory)
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 NativeScript / nativescript-sdk-examples-ng / app / ng-ui-category / modal-view-ng / modal-view-examples.module.ts View on Github external
children: [
            {
                path: "modal-view", component: ModalViewActionBarComponent
            }
        ]
    }
    // << modal-view-routes-actionbar
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [
        ModalViewExamplesComponent,
        SampleModalViewModuleExampleComponent,
        ModalViewNavigationComponent,
        ModalViewComponent,
        HomeModalViewComponent,
        HomeModalViewContentComponent,
        SecondModalViewContentComponent,
        MainViewComponent,
        ModalRootComponent,
        ModalViewActionBarComponent
    ],
    entryComponents: [ModalViewComponent, HomeModalViewComponent, ModalRootComponent]
})
github danielgek / nativescript-sentry / demo-ng / 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 { platformNativeScriptDynamic } from 'nativescript-angular/platform';
import { AppModule } from './app.module';

// A traditional NativeScript application starts by initializing global objects, setting up global CSS rules, creating, and navigating to the main page.
// Angular applications need to take care of their own initialization: modules, components, directives, routes, DI providers.
// A NativeScript Angular app needs to make both paradigms work together, so we provide a wrapper platform object, platformNativeScriptDynamic,
// that sets up a NativeScript application and can bootstrap the Angular framework.
platformNativeScriptDynamic({ createFrameOnBootstrap: true }).bootstrapModule(AppModule);
github JoshDSommer / nativescript-ngx-slides / 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 { platformNativeScriptDynamic } from "nativescript-angular/platform";

import { AppModule } from "./app.module";

platformNativeScriptDynamic().bootstrapModule(AppModule);
github PeterStaev / NativeScript-Drop-Down / demo-ng / 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 { platformNativeScriptDynamic } from "nativescript-angular/platform";

import { AppModule } from "./app.module";

platformNativeScriptDynamic().bootstrapModule(AppModule);
github anihalaney / rwa-trivia / projects / trivia / src / main.ns.ts View on Github external
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import { platformNativeScriptDynamic } from 'nativescript-angular/platform';

import { AppModule } from './app/app.module';



// A traditional NativeScript application starts by initializing global objects, setting up global CSS rules, creating, and navigating to the main page. 
// Angular applications need to take care of their own initialization: modules, components, directives, routes, DI providers. 
// A NativeScript Angular app needs to make both paradigms work together, so we provide a wrapper platform object, platformNativeScriptDynamic, 
// that sets up a NativeScript application and can bootstrap the Angular framework.
platformNativeScriptDynamic().bootstrapModule(AppModule);
github dapriett / nativescript-google-maps-sdk / ng-demo / 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 { platformNativeScriptDynamic } from "nativescript-angular/platform";

import { AppModule } from "./app.module";

platformNativeScriptDynamic().bootstrapModule(AppModule);