當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.ApplicationRef類代碼示例

本文整理匯總了TypeScript中angular2/core.ApplicationRef的典型用法代碼示例。如果您正苦於以下問題:TypeScript ApplicationRef類的具體用法?TypeScript ApplicationRef怎麽用?TypeScript ApplicationRef使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ApplicationRef類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: routerFactory

function routerFactory(
    registry: RouteRegistry, location: Location, primaryComponent: Type,
    appRef: ApplicationRef): RootRouter {
  var rootRouter = new RootRouter(registry, location, primaryComponent);
  appRef.registerDisposeListener(() => rootRouter.dispose());
  return rootRouter;
}
開發者ID:LordBinary,項目名稱:angular,代碼行數:7,代碼來源:router_providers_common.ts

示例2: routerFactory

function routerFactory(app: ApplicationRef, componentResolver: ComponentResolver,
                       urlSerializer: RouterUrlSerializer, routerOutletMap: RouterOutletMap,
                       location: Location): Router {
  if (app.componentTypes.length == 0) {
    throw new BaseException("Bootstrap at least one component before injecting Router.");
  }
  // TODO: vsavkin this should not be null
  let router = new Router(null, app.componentTypes[0], componentResolver, urlSerializer,
                          routerOutletMap, location);
  app.registerDisposeListener(() => router.dispose());
  return router;
}
開發者ID:JavaScript-Resource,項目名稱:angular,代碼行數:12,代碼來源:router_providers_common.ts

示例3: setTimeout

        router.subscribe(() => {

            // This is needed for the back button to work correctly on iOS and Safari.
            this._applicationRef.tick();
            setTimeout(() => {
                this._applicationRef.tick();
            }, 100);
        });
開發者ID:xerik25,項目名稱:volleyball,代碼行數:8,代碼來源:app.component.ts

示例4:

		this.blogServer.list().then((result)=>{
			if(result.code == StatusCode.success) {
				this.blogList = result.data.list;
				this.count = result.data.count;
				this.page = result.data.page;
				this.applicationRef.tick();
			}else{
				console.log(result);
			}
		}).catch((result)=>{
開發者ID:Mapleiny,項目名稱:FLCTCollection,代碼行數:10,代碼來源:listView.ts

示例5:

 this.unsubscribe = ngRedux.subscribe(() => {
   applicationRef.tick();
 });
開發者ID:lokeshjain2008,項目名稱:angular2-redux-starter,代碼行數:3,代碼來源:sample-app.ts

示例6:

 state => {
   console.log('Received new store state: ', state.todos);
   this.todos = state.todos;
   applicationRef.tick();
 }
開發者ID:pedrogusman,項目名稱:ionic-2-redux-starter,代碼行數:5,代碼來源:page1.ts

示例7:

 this.router.subscribe(() => {
     this.applicationRef.tick();
 });
開發者ID:Mapleiny,項目名稱:FLCTCollection,代碼行數:3,代碼來源:app.ts


注:本文中的angular2/core.ApplicationRef類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。