How to use the nativescript-angular/element-registry.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 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 dapriett / nativescript-google-maps-sdk / ng-demo / app / map / map.component.ts View on Github external
import {Component, ViewChild} from '@angular/core';
import { registerElement } from 'nativescript-angular/element-registry';
import { MapView, Marker, Position } from 'nativescript-google-maps-sdk';


// Important - must register MapView plugin in order to use in Angular templates
registerElement('MapView', () => MapView);

@Component({
    moduleId: module.id,
    selector: 'map',
    templateUrl: 'map.html',
    styleUrls: ['map.css'],
})
export class MapComponent {

    latitude =  -33.86;
    longitude = 151.20;
    zoom = 8;
    minZoom = 0;
    maxZoom = 22;
    bearing = 0;
    tilt = 0;
github jlooper / nativescript-paint / demo-ng / app / app.module.ts View on Github external
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { NativeScriptModule } from 'nativescript-angular/nativescript.module';
import { AppRoutingModule } from './app.routing';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { registerElement } from 'nativescript-angular/element-registry';
import { PaintPad } from 'nativescript-paint';
registerElement('PaintPad', () => require('nativescript-paint').PaintPad);

@NgModule({
	bootstrap: [AppComponent],
	imports: [NativeScriptModule, AppRoutingModule],
	declarations: [AppComponent, HomeComponent],
	providers: [PaintPad],
	schemas: [NO_ERRORS_SCHEMA],
})
/*
Pass your application module to the bootstrapModule function located in main.ts to start your app
*/
export class AppModule {}
github yezarela / nativescript-image-cache / ns-image-cache.android.ts View on Github external
export function initializeOnAngular() {
    if (false === isInitialized) {
        var _elementRegistry = require("nativescript-angular/element-registry");

        _elementRegistry.registerElement("NSImage", function () {
            return require("nativescript-image-cache").NSImage;
        });
        initialize();
        isInitialized = true;
    }
}
github NativeScript / nativescript-datetimepicker / src / angular / nativescript-datetimepicker.module.ts View on Github external
import { NgModule } from "@angular/core";
import { registerElement } from "nativescript-angular/element-registry";
import { DatePickerField } from "../ui/date-picker-field";
import { TimePickerField } from "../ui/time-picker-field";
import { DateTimePickerFields } from "../ui/date-time-picker-fields";

import { DIRECTIVES } from "./nativescript-datetimepicker.directives";

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

registerElement("DatePickerField", () => DatePickerField);
registerElement("TimePickerField", () => TimePickerField);
registerElement("DateTimePickerFields", () => DateTimePickerFields);
github triniwiz / nativescript-webrtc / src / angular / nativescript-webrtc.module.ts View on Github external
import { NgModule } from '@angular/core';
import { registerElement } from 'nativescript-angular/element-registry';

import { NSWEBRTCVIEW_DIRECTIVES } from './nativescript-webrtc-directives';
import { WebRTCView } from '../';

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

@NgModule({
    declarations: [NSWEBRTCVIEW_DIRECTIVES],
    exports: [NSWEBRTCVIEW_DIRECTIVES]
})
export class WebRTCModule {
}
github VideoSpike / nativescript-web-image-cache / WebImageCache.android.js View on Github external
exports.initializeOnAngular = function() {

  if (false === isInitialized) {
    var _elementRegistry = require("nativescript-angular/element-registry");


    _elementRegistry.registerElement("WebImage", function() {
      return require("nativescript-web-image-cache").WebImage;
    });
    initialize();
    isInitialized = true;
  }
};
github charsleysa / nativescript-mdc / src / components / bottomAppBar / angular / index.ts View on Github external
import { registerElement } from 'nativescript-angular/element-registry';

import { DIRECTIVES, bottomAppBarMeta } from './directives';

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

registerElement('MDCBottomAppBar', () => require('../bottomAppBar').BottomAppBar, bottomAppBarMeta);
registerElement('MDCActionItem', () => require('../bottomAppBar').ActionItem);
registerElement('MDCNavigationButton', () => require('../bottomAppBar').NavigationButton);
registerElement('MDCMainActionButton', () => require('../bottomAppBar').MainActionButton);
github LeCaoPhuc / nativescript-mpchart / src / angular / mpchart.module.ts View on Github external
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { registerElement } from "nativescript-angular/element-registry";
registerElement("MPLineChart", () => require("../chart").MPLineChart);
registerElement("MPBarChart", () => require("../chart").MPBarChart);

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
})
export class NativeScriptMPLineChartModule {

}
github skhye05 / nativescript-bubble-navigation / src / angular / bubble-navigation.module.ts View on Github external
import { NgModule } from '@angular/core';

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

import { BubbleNavigationDirective } from './bubble-navigation.directive';

@NgModule({
    declarations: [BubbleNavigationDirective],
    exports: [BubbleNavigationDirective],
})
export class BubbleNavigationModule { }