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


TypeScript BrowserDomAdapter.makeCurrent方法代碼示例

本文整理匯總了TypeScript中angular2/platform/browser.BrowserDomAdapter.makeCurrent方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript BrowserDomAdapter.makeCurrent方法的具體用法?TypeScript BrowserDomAdapter.makeCurrent怎麽用?TypeScript BrowserDomAdapter.makeCurrent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angular2/platform/browser.BrowserDomAdapter的用法示例。


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

示例1: Movie

import {provide} from "angular2/core";
import {BrowserDomAdapter} from 'angular2/platform/browser';
import {it, describe, expect, inject, beforeEachProviders, 
	   beforeEach, TestComponentBuilder, injectAsync} from "angular2/testing";
import {Observable} from "rxjs";
import {Movie} from "../app/models/Movie";
import {MovieList} from "../app/list/movie-list";
import {MovieService} from "../app/services/MovieService";
import {HTTP_PROVIDERS, Http} from "angular2/http";
import {Router} from "angular2/router";

BrowserDomAdapter.makeCurrent();

class FakeService extends MovieService {
	
	constructor() {
		super(null);
	}
	
	getAll() {	
		let movies = [[
			new Movie(1, "", 1, 1),
			new Movie(1, "", 1, 1),
			new Movie(1, "", 1, 1) 
		]];
		return Observable.from(movies);
	}
	
}

describe("The MovieList component", () => {
開發者ID:HansS,項目名稱:AtTheMovies-angular2-scott-allen,代碼行數:31,代碼來源:MovieListSpecB.ts


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