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 Akylas / nativescript-material-components / src / appbar / angular / material-components.module.ts View on Github external
import { NgModule } from '@angular/core';

import { AppBarComponent, appBarMeta } from './app-bar';
import { AppBarDirective } from './appbar.directive';
// Uncomment and add to NgModule imports if you need to use two-way binding
// import { NativeScriptFormsModule } from "nativescript-angular/forms";

import { registerElement } from '@nativescript/angular/element-registry';
registerElement('AppBar', () => require('../appbar').AppBar, appBarMeta);

@NgModule({
    imports: [],
    declarations: [AppBarComponent, AppBarDirective],
    exports: [AppBarComponent, AppBarDirective],
    providers: []
})
export class MaterialComponentsModule {}
github Akylas / nativescript-material-components / demo-ng / src / 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/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 Akylas / nativescript-material-components / src / textfield / angular / index.ts View on Github external
import { NgModule } from '@angular/core';
import { TextValueAccessor } from './textvalue-accessor';

import { registerElement } from '@nativescript/angular/element-registry';

export const FORMS_DIRECTIVES = [TextValueAccessor];

@NgModule({
    declarations: FORMS_DIRECTIVES,
    exports: FORMS_DIRECTIVES
})
export class NativeScriptMaterialTextFieldModule {}

registerElement('MDTextField', () => require('../textfield').TextField);
github Notalib / nativescript-webview-ext / src / angular / index.ts View on Github external
import { NgModule } from "@angular/core";
import { isKnownView, registerElement } from "@nativescript/angular/element-registry";

const webviewElementName = "WebViewExt";

if (!isKnownView(webviewElementName)) {
    registerElement(webviewElementName, () => require("../webview-ext").WebViewExt);
}

@NgModule()
export class WebViewExtModule {}
github Akylas / nativescript-material-components / src / ripple / angular / index.ts View on Github external
import { Directive, NgModule } from '@angular/core';
import { registerElement } from '@nativescript/angular/element-registry';

@Directive({ selector: 'MDRipple' })
export class MaterialRippleDirective {}

@NgModule({
    declarations: [MaterialRippleDirective],
    exports: [MaterialRippleDirective]
})
export class NativeScriptMaterialRippleModule {}

registerElement('MDRipple', () => require('../ripple').Ripple);
github Akylas / nativescript-material-components / src / button / angular / index.ts View on Github external
import { NgModule } from '@angular/core';
import { registerElement } from '@nativescript/angular/element-registry';

import { Directive } from '@angular/core';

@Directive({ selector: 'MDButton' })
export class MaterialButtonDirective {}

@NgModule({
    declarations: [MaterialButtonDirective],
    exports: [MaterialButtonDirective]
})
export class NativeScriptMaterialButtonModule {}

registerElement('MDButton', () => require('../button').Button);
github Akylas / nativescript-material-components / src / bottomnavigationbar / angular / nativescript-material-bottomnavigationbar.module.ts View on Github external
import { NgModule } from '@angular/core';
import { registerElement } from '@nativescript/angular/element-registry';

import { DIRECTIVES } from './nativescript-material-bottomnavigationbar.directives';

@NgModule({
    declarations: [DIRECTIVES],
    exports: [DIRECTIVES]
})
export class NativeScriptMaterialBottomNavigationBarModule {}

registerElement('BottomNavigationBar', () => require('../').BottomNavigationBar);
registerElement('BottomNavigationTab', () => require('../').BottomNavigationTab);
github Akylas / nativescript-material-components / src / slider / angular / index.ts View on Github external
import { NgModule } from '@angular/core';
import { registerElement } from '@nativescript/angular/element-registry';

import { Directive } from '@angular/core';

@Directive({ selector: 'MDSlider' })
export class MaterialSliderDirective {}

@NgModule({
    declarations: [MaterialSliderDirective],
    exports: [MaterialSliderDirective]
})
export class NativeScriptMaterialSliderModule {}

registerElement('MDSlider', () => require('../slider').Slider);
github Akylas / nativescript-material-components / src / progress / angular / index.ts View on Github external
import { NgModule } from '@angular/core';
import { registerElement } from '@nativescript/angular/element-registry';

import { Directive } from '@angular/core';

@Directive({ selector: 'MDProgress' })
export class MaterialProgressDirective {}

@NgModule({
    declarations: [MaterialProgressDirective],
    exports: [MaterialProgressDirective]
})
export class NativeScriptMaterialProgressModule {}

registerElement('MDProgress', () => require('../progress').Progress);
github Akylas / nativescript-material-components / src / floatingactionbutton / angular / index.ts View on Github external
import { NgModule } from '@angular/core';
import { registerElement } from '@nativescript/angular/element-registry';

@NgModule()
export class NativeScriptMaterialFloatingButtonModule {}

registerElement('MDFloatingActionButton', () => require('../floatingactionbutton').FloatingActionButton);