How to use the nativescript-angular.registerElement 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 sean-perkins / nativescript-petfinder / app / app.module.ts View on Github external
import { AppRoutingModule } from './app.routing';
import { AppComponent } from './app.component';

import { StoreModule } from '@ngrx/store';
import { AppStoreModule } from './store/store.module';
import { AppReducer } from './store/app.state';
import { NavigationModule } from './navigation/navigation.module';

// Uncomment and add to NgModule imports if you need to use two-way binding
// import { NativeScriptFormsModule } from 'nativescript-angular/forms';

// Uncomment and add to NgModule imports  if you need to use the HTTP wrapper
import { NativeScriptHttpModule } from 'nativescript-angular/http';

registerElement('Carousel', () => require('nativescript-carousel').Carousel);
registerElement('CarouselItem', () => require('nativescript-carousel').CarouselItem);

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        NativeScriptModule,
        NativeScriptHttpModule,
        AppRoutingModule,
        AppStoreModule,
        NavigationModule,
        StoreModule.provideStore(AppReducer),
    ],
    declarations: [
        AppComponent,
    ],
github sean-perkins / nativescript-petfinder / app / app.module.ts View on Github external
import { registerElement } from 'nativescript-angular';
import { AppRoutingModule } from './app.routing';
import { AppComponent } from './app.component';

import { StoreModule } from '@ngrx/store';
import { AppStoreModule } from './store/store.module';
import { AppReducer } from './store/app.state';
import { NavigationModule } from './navigation/navigation.module';

// Uncomment and add to NgModule imports if you need to use two-way binding
// import { NativeScriptFormsModule } from 'nativescript-angular/forms';

// Uncomment and add to NgModule imports  if you need to use the HTTP wrapper
import { NativeScriptHttpModule } from 'nativescript-angular/http';

registerElement('Carousel', () => require('nativescript-carousel').Carousel);
registerElement('CarouselItem', () => require('nativescript-carousel').CarouselItem);

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        NativeScriptModule,
        NativeScriptHttpModule,
        AppRoutingModule,
        AppStoreModule,
        NavigationModule,
        StoreModule.provideStore(AppReducer),
    ],
    declarations: [
        AppComponent,
github rhanb / nativescript-bottombar / demo / app / app.component.ts View on Github external
import { Component } from "@angular/core";
import { registerElement } from 'nativescript-angular';
import { BottomBar, BottomBarItem, TITLE_STATE, SelectedIndexChangedEventData } from 'nativescript-bottombar';

registerElement('BottomBar', () => BottomBar);

@Component({
    selector: "nsapp",
    templateUrl: "app.component.html",
})

export class AppComponent {
    currentInc: number = 0;

 public hidden: boolean;
    public titleState: TITLE_STATE;

    public items: Array = [
        new BottomBarItem(0, "Home", "ic_home_black_24dp", "black", "1"),
        new BottomBarItem(1, "Calendar", "ic_calendar", "#1083BF", "2"),
        new BottomBarItem(2, "Profile", "ic_collaborator", "pink", "3"),
github bradmartin / nativescript-lottie / demo-angular / src / app / home / home.component.ts View on Github external
import { Component } from '@angular/core';
import { registerElement } from 'nativescript-angular';
import { LottieView } from 'nativescript-lottie';
import { Color } from 'tns-core-modules/color/color';

registerElement('LottieView', () => LottieView);

const ANDROID_WAVE_KEYPATHS = [
  ['Shirt', 'Group 5', 'Fill 1'],
  ['LeftArmWave', 'LeftArm', 'Group 6', 'Fill 1'],
  ['RightArm', 'Group 6', 'Fill 1']
];

@Component({
  selector: 'ns-home',
  templateUrl: './home.component.html',
  moduleId: module.id
})
export class HomeComponent {
  public animationIndex: number = 0;
  public animations: string[] = [
    'Mobilo/B.json',
github nstudio / nativescript-cardview / demo-angular / src / app / app.component.ts View on Github external
import { Component } from '@angular/core';
import { CardView } from '@nstudio/nativescript-cardview';
import { registerElement } from 'nativescript-angular';

registerElement('CardView', () => CardView as any);

@Component({
    selector: 'ns-app',
    moduleId: module.id,
    templateUrl: './app.component.html'
})
export class AppComponent {}
github vcooley / nativescript-input-mask / src / angular / input-mask.module.ts View on Github external
import { InputMaskTextValueAccessor } from './input-mask.directive';
import { FormsModule } from '@angular/forms';

@NgModule({
  declarations: [ InputMaskTextValueAccessor ],
  providers: [],
  imports: [ FormsModule ],
  exports: [
    InputMaskTextValueAccessor,
    FormsModule,
  ],
})
export class InputMaskModule {
}

registerElement('InputMask', () => require('../').InputMask);
github EddyVerbruggen / nativescript-pluginshowcase / app / app.module.ts View on Github external
} from "nativescript-angular";
import { TNSFontIconModule } from "nativescript-ngx-fonticon";
import { NativeScriptAnimationsModule } from "nativescript-angular/animations";
import { AppShortcuts } from "nativescript-app-shortcuts";
import { device, isIOS } from "tns-core-modules/platform";
import { DeviceType } from "tns-core-modules/ui/enums";
import * as application from "application";
import { ToastService } from "./services/toast.service";
import { HomeComponent } from "~/home/home.component";
import { CommonModule } from "@angular/common";
import { NativeScriptUISideDrawerModule } from "nativescript-ui-sidedrawer/angular";
import { NativeScriptUIListViewModule } from "nativescript-ui-listview/angular";

const fs = require("tns-core-modules/file-system");

registerElement("FAB", () => require("nativescript-floatingactionbutton").Fab);

setStatusBarColors();

Config.isTablet = device.deviceType === DeviceType.Tablet;

@NgModule({
  bootstrap: [
    AppComponent
  ],
  imports: [
    NativeScriptModule,
    CommonModule,
    NativeScriptFormsModule,
    NativeScriptRouterModule,
    NativeScriptAnimationsModule,
    NativeScriptUISideDrawerModule,
github EddyVerbruggen / nativescript-ar / demo-pokemon / src / app / app.module.ts View on Github external
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { registerElement } from "nativescript-angular";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import { NativeScriptUISideDrawerModule } from "nativescript-ui-sidedrawer/angular";
import { PokemonDataService } from "~/app/pokemon-data/pokemon-data-service";
import { PokemonFavoritesService } from "~/app/pokemon-data/pokemon-favorites-service";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";

registerElement("AR", () => require("nativescript-ar").AR);

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        AppRoutingModule,
        NativeScriptModule,
        NativeScriptUISideDrawerModule
    ],
    declarations: [
        AppComponent
    ],
    providers: [
        PokemonDataService,
        PokemonFavoritesService