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

TypeScript bootstrap.bootstrap函数代码示例

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

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



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

示例1: main

export function main() {
  var size = getIntParameter('size');
  testList = ListWrapper.createFixedSize(size);

  bootstrap(AppComponent)
      .then((ref) => {
        var injector = ref.injector;
        var app: AppComponent = ref.hostComponent;
        var lifeCycle = injector.get(LifeCycle);

        bindAction('#reset', function() {
          app.reset();
          lifeCycle.tick();
        });

        // Baseline (plain components)
        bindAction('#createPlainComponents', function() {
          app.createPlainComponents();
          lifeCycle.tick();
        });

        // Components with decorators
        bindAction('#createComponentsWithDirectives', function() {
          app.createComponentsWithDirectives();
          lifeCycle.tick();
        });

        // Components with decorators
        bindAction('#createDynamicComponents', function() {
          app.createDynamicComponents();
          lifeCycle.tick();
        });
      });
}
开发者ID:goderbauer,项目名称:angular,代码行数:34,代码来源:index.ts


示例2: bootstrap

export function bootstrap(appComponentType: any,
                          providers: Array<Type | Provider | any[]> = null) {
  const bootstrapProviders = MeteorProviders;
  if (providers) {
    providers.forEach((element) => bootstrapProviders.push(element));
  }
  ng2Bootstrap(appComponentType, providers);
}
开发者ID:fuzolan,项目名称:angular2-meteor-client,代码行数:8,代码来源:bootstrap.ts


示例3: main

export function main() {
  // Bootstrapping only requires specifying a root component.
  // The boundary between the Angular application and the rest of the page is
  // the shadowDom of this root component.
  // The selector of the component passed in is used to find where to insert the
  // application.
  // You can use the light dom of the <hello-app> tag as temporary content (for
  // example 'Loading...') before the application is ready.
  bootstrap(HelloCmp);
}
开发者ID:goderbauer,项目名称:angular,代码行数:10,代码来源:index.ts


示例4: main

export function main() {
  return bootstrap(App, [
    FORM_PROVIDERS,
    ROUTER_PROVIDERS,
    HTTP_PROVIDERS,
    ELEMENT_PROBE_PROVIDERS,

    APP_PROVIDERS,
  ]).catch(e => console.error(e));
}
开发者ID:windwang,项目名称:angular2-app,代码行数:10,代码来源:bootstrap.ts


示例5: bootstrap

document.addEventListener('DOMContentLoaded', () => {
  bootstrap(App, [
    ...FORM_PROVIDERS,
    ...ROUTER_PROVIDERS,
    ...HTTP_PROVIDERS,
    ...ENV_PROVIDERS,
    ...APP_PROVIDERS,
  ]).then((appRef:ComponentRef) => {
    appInjector(appRef.injector);
  }).catch(e => console.error(e));
});
开发者ID:ishara,项目名称:angular2-app,代码行数:11,代码来源:main.ts


示例6: it

      it('should bootstrap a simple app', inject([AsyncTestCompleter], (async) => {
           var fakeDoc = DOM.createHtmlDocument();
           var el = DOM.createElement('app-cmp', fakeDoc);
           DOM.appendChild(fakeDoc.body, el);

           bootstrap(AppCmp,
                     [
                       ROUTER_PROVIDERS,
                       provide(ROUTER_PRIMARY_COMPONENT, {useValue: AppCmp}),
                       provide(LocationStrategy, {useClass: MockLocationStrategy}),
                       provide(DOCUMENT, {useValue: fakeDoc})
                     ])
               .then((applicationRef) => {
                 var router = applicationRef.hostComponent.router;
                 router.subscribe((_) => {
                   expect(el).toHaveText('outer { hello }');
                   expect(applicationRef.hostComponent.location.path()).toEqual('');
                   async.done();
                 });
               });
         }));
开发者ID:,项目名称:,代码行数:21,代码来源:


示例7: main

export function main() {
  reflector.reflectionCapabilities = new ReflectionCapabilities();
  bootstrap(InboxApp,
            [ROUTER_PROVIDERS, provide(LocationStrategy, {useClass: HashLocationStrategy})]);
}
开发者ID:TedSander,项目名称:angular,代码行数:5,代码来源:index.ts


示例8: function

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var angular2_1 = require('angular2/angular2');
var bootstrap_1 = require('angular2/bootstrap');
var NeuralNet = (function () {
    function NeuralNet() {
    }
    NeuralNet = __decorate([
        angular2_1.Component({
            selector: 'neuralnet',
            template: 'hello world again'
        }), 
        __metadata('design:paramtypes', [])
    ], NeuralNet);
    return NeuralNet;
}());
bootstrap_1.bootstrap(NeuralNet);
开发者ID:molliecool,项目名称:NeuralNet,代码行数:25,代码来源:app.ts


示例9: main

export function main() {
  commonDemoSetup();
  bootstrap(DemoApp, [provide(UrlResolver, {useValue: new DemoUrlResolver()})]);
}
开发者ID:ASLA1899,项目名称:angular,代码行数:4,代码来源:index.ts


示例10: require

import {Component, View, Inject, enableProdMode} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import configureStore from './store/configure-store';
import App from './containers/app';
const provider = require('ng2-redux').provider;
const store = configureStore();
declare let __PRODUCTION__: any;

if (__PRODUCTION__) {
  enableProdMode();
}

bootstrap(App, [ provider(store) ]);
开发者ID:AbdellaToronto,项目名称:angular2-redux-starter,代码行数:13,代码来源:index.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript change_detection.BindingRecord类代码示例发布时间:2022-05-25
下一篇:
TypeScript angular2.ViewContainerRef类代码示例发布时间: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