• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript element-registry.registerElement函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中nativescript-angular/element-registry.registerElement函数的典型用法代码示例。如果您正苦于以下问题:TypeScript registerElement函数的具体用法?TypeScript registerElement怎么用?TypeScript registerElement使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了registerElement函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: constructor

    constructor(page: Page, _routerExtensions: RouterExtensions, private _chatService: ChatService, private _userIdService: UserIdService, private _textService: TextService, private _ngZone: NgZone) {
        this._userIdService.getUserId()
            .then((userID: string) => {
                this.userID = userID;
                this._chatService.connectToChatWithGuestID(userID, userID, () => {}, this, false);
            });
        page.actionBarHidden = true;

        //allows for ios statusbar coloring
        page.backgroundSpanUnderStatusBar = true;
        page.backgroundColor = new Color("lightblue");
        try {
            registerElement("StatusBar", () => require("nativescript-statusbar").StatusBar);
        } catch (error) { }
    }
开发者ID:mattpcaswell,项目名称:bespoke-concierge,代码行数:15,代码来源:guestScreen.component.ts


示例2: constructor

    constructor(page: Page, private _router: Router, private _taskService: TaskService, private _databaseService: DatabaseService, private _userIdService: UserIdService, private _chatListService: ChatListService) {
        //get userId
        this._userIdService.getUserId().then((userID: string) => {
            this.userID = userID;
        }).catch((error: any) => {
            console.log("Error getting userID");
            console.log(error);
        });

        page.actionBarHidden = true;
        page.backgroundSpanUnderStatusBar = true; //allows for ios statusbar coloring
        page.backgroundColor = new Color("lightblue");
        try {
            registerElement("StatusBar", () => require("nativescript-statusbar").StatusBar);
        } catch (error) { }
    }
开发者ID:mattpcaswell,项目名称:bespoke-concierge,代码行数:16,代码来源:staffScreen.component.ts


示例3: registerElement

// this import should be first in order to load some required settings (like globals and reflect-metadata)
import {nativeScriptBootstrap} from "nativescript-angular/application";
import {NS_ROUTER_DIRECTIVES,NS_ROUTER_PROVIDERS} from  "nativescript-angular/router-deprecated/ns-router-deprecated";
import {AppComponent} from "./app.component";

import {registerElement} from "nativescript-angular/element-registry";
registerElement("DropDown", ()=> require("nativescript-drop-down/drop-down").DropDown);

nativeScriptBootstrap(AppComponent, [NS_ROUTER_PROVIDERS]);
开发者ID:Mcdeep,项目名称:Rewards,代码行数:9,代码来源:main.ts


示例4: registerElement

import { AppRoutingModule } from "./app.routing";
import { AppComponent } from "./app.component";

import { ItemService } from "./item/item.service";
import { ItemsComponent } from "./item/items.component";
import { ItemDetailComponent } from "./item/item-detail.component";

// 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";
import { registerElement } from "nativescript-angular/element-registry";
import { BarcodeScanner } from "nativescript-barcodescanner";
import { ModalComponent } from "~/item/modal/modal.component";
registerElement("BarcodeScanner", () => require("nativescript-barcodescanner").BarcodeScannerView);

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        NativeScriptModule,
        AppRoutingModule
    ],
    declarations: [
        AppComponent,
        ItemsComponent,
        ItemDetailComponent,
        ModalComponent
    ],
开发者ID:EddyVerbruggen,项目名称:nativescript-barcodescanner,代码行数:31,代码来源:app.module.ts


示例5: registerElement

// config
import {Config, WindowService} from './app/frameworks/core/index';
Config.PLATFORM_TARGET = Config.PLATFORMS.MOBILE_NATIVE;
Config.DEBUG.LEVEL_4 = true;
Config.ROUTER_DIRECTIVES = NS_ROUTER_DIRECTIVES;

// app
import {NS_APP_PROVIDERS} from './shared/nativescript/index';
import {routes} from './app/components/app/app.routes';
import {NSAppComponent} from './pages/app/app.component';
import {WindowNative} from './shared/core/index';
import {registerElement} from "nativescript-angular/element-registry";
import {PAGE} from "./app/frameworks/core/tokens/opakeToken";
import {Page} from "ui/page";
registerElement("CardView", () => require("nativescript-cardview").CardView);
registerElement("StatusBar", () => require("nativescript-statusbar").StatusBar);

// Uncomment when ready to publish to App Stores:
// enableProdMode();

nativeScriptBootstrap(NSAppComponent, [
    provide(WindowService, {useClass: WindowNative}),
    provide(PAGE, {useValue: Page}),
    provide(TranslateLoader, {
        useFactory: () => {
            return new TNSTranslateLoader('assets/i18n');
        }
    }),
    NS_APP_PROVIDERS,
    nsProvideRouter(routes, {enableTracing: false})
开发者ID:NathanWalker,项目名称:wtm-seed-current,代码行数:30,代码来源:app.ts


示例6: registerElement

import { Component, OnInit, NgModule, ViewChild, ElementRef } from '@angular/core';
import { TNSCheckBoxModule } from 'nativescript-checkbox/angular';
import { registerElement } from "nativescript-angular/element-registry";
import { MapboxMarker, MapboxView } from "nativescript-mapbox";
import { RouterExtensions } from 'nativescript-angular/router';

registerElement("Mapbox", () => require("nativescript-mapbox").MapboxView);
var mapbox = require("nativescript-mapbox");

@NgModule({
    imports: [TNSCheckBoxModule],
})
export class ChekBoxModule {}

@Component({
  selector: 'app-operation-question',
  templateUrl: './operation-question.component.html',
  styleUrls: ['./operation-question.component.css']
})
export class OperationQuestionComponent implements OnInit {

  public message: string;

  constructor(private router: RouterExtensions) { }

  ngOnInit() {}

  public onMapReady(args) {
    // you can tap into the native MapView objects (MGLMapView for iOS and com.mapbox.mapboxsdk.maps.MapView for Android)
    var nativeMapView = args.ios ? args.ios : args.android;
    console.log("Mapbox onMapReady for " + (args.ios ? "iOS" : "Android") + ", native object received: " + nativeMapView);
开发者ID:JaymePreto,项目名称:emergency193,代码行数:31,代码来源:operation-question.component.ts


示例7: registerElement

import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import { AppComponent } from "./app.component";
import {registerElement} from "nativescript-angular/element-registry";
registerElement("MapView", () => require("nativescript-google-maps-sdk").MapView);

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        NativeScriptModule
    ],
    declarations: [
        AppComponent
    ],
    providers: [
    ],
    schemas: [
        NO_ERRORS_SCHEMA
    ]
})
export class AppModule { }
开发者ID:tsonevn,项目名称:NativeScript-Angular-GoogleMaps,代码行数:23,代码来源:app.module.ts


示例8: registerElement

import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptCommonModule } from "nativescript-angular/common";

import { FirestoreComponent } from "./firestore/firestore.component";
import { MLKitComponent } from "./mlkit/mlkit.component";
import { TabsRoutingModule } from "./tabs-routing.module";
import { TabsComponent } from "./tabs.component";

import { TextRecognitionComponent } from "~/tabs/mlkit/textrecognition/textrecognition.component";
import { BarcodeScanningComponent } from "~/tabs/mlkit/barcodescanning/barcodescanning.component";
import { FaceDetectionComponent } from "~/tabs/mlkit/facedetection/facedetection.component";
import { ImageLabelingComponent } from "~/tabs/mlkit/imagelabeling/imagelabeling.component";

import { registerElement } from "nativescript-angular/element-registry";
registerElement("MLKitBarcodeScanner", () => require("nativescript-plugin-firebase/mlkit/barcodescanning").MLKitBarcodeScanner);
registerElement("MLKitFaceDetection", () => require("nativescript-plugin-firebase/mlkit/facedetection").MLKitFaceDetection);
registerElement("MLKitTextRecognition", () => require("nativescript-plugin-firebase/mlkit/textrecognition").MLKitTextRecognition);
registerElement("MLKitImageLabeling", () => require("nativescript-plugin-firebase/mlkit/imagelabeling").MLKitImageLabeling);

@NgModule({
  imports: [
    NativeScriptCommonModule,
    TabsRoutingModule
  ],
  declarations: [
    BarcodeScanningComponent,
    FaceDetectionComponent,
    FirestoreComponent,
    ImageLabelingComponent,
    MLKitComponent,
    TabsComponent,
开发者ID:TitaniumCortez,项目名称:nativescript-plugin-firebase,代码行数:31,代码来源:tabs.module.ts


示例9: registerElement

import {Component, ElementRef, ViewChild} from '@angular/core';
import {registerElement} from "nativescript-angular/element-registry";

registerElement("DrawingPad", () => require("nativescript-drawingpad").DrawingPad);

@Component({
    selector: 'drawing-pad-example',
    template: `
    <ScrollView>
        <StackLayout>
            <DrawingPad #DrawingPad 
            height="400" 
            id="drawingPad" 
            penColor="#ff4081" penWidth="3">
            </DrawingPad>

            <StackLayout orientation="horizontal">
                <Button text="Get Drawing" (tap)="getMyDrawing()"></Button>
                <Button text="Clear Drawing" (tap)="clearMyDrawing()"></Button>
            </StackLayout>
        </StackLayout>
    </ScrollView>
    `
})
export class DrawingPadExample {

    @ViewChild("DrawingPad") DrawingPad: ElementRef;

    getMyDrawing(args) {
        // get reference to the drawing pad
        let pad = this.DrawingPad.nativeElement;
开发者ID:NathanWalker,项目名称:nativescript-drawingpad,代码行数:31,代码来源:drawing-pad.component.ts


示例10: registerElement

import { Component, OnInit } from '@angular/core';
import { registerElement } from 'nativescript-angular/element-registry';
import { CardView } from 'nativescript-cardview';
import { ArticleService } from './article/article.service';

registerElement("CardView", () => CardView);

@Component({
  moduleId: module.id,
  selector: "articles-list",
  styleUrls: ['./articles-list.component.css'],
  templateUrl: "./articles-list.component.html"
})


export class ArticlesListComponent {

  genius: any[];

  constructor(private _articleService: ArticleService) { }

  onSubmit(event) {
    let query = event.object.text;
    console.log(query);
    this._articleService.getArticles(query)
    .subscribe((data: any) => {
      this.genius = data.response.hits;
    });
  }

  
开发者ID:jalamerian,项目名称:LyricsSong,代码行数:29,代码来源:articles-list.component.ts



注:本文中的nativescript-angular/element-registry.registerElement函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript http-client.NsHttpBackEnd类代码示例发布时间:2022-05-25
下一篇:
TypeScript dialogs.ModalDialogService类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap