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


TypeScript router.RouteSegment類代碼示例

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


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

示例1: constructor

    constructor(params:RouteSegment, commBroker:CommBroker) {
        if (params.getParam('id') != null) {
            commBroker.setValue(Consts.Values().USER_NAME, params.getParam('id'));
        } else {
            commBroker.setValue(Consts.Values().USER_NAME, 'foo-bar');
        }

    }
開發者ID:Rahman-S-M,項目名稱:ng2Boilerplate,代碼行數:8,代碼來源:EntryPanel.ts

示例2: routerOnActivate

 routerOnActivate(curr:RouteSegment, prev?:RouteSegment, currTree?:RouteTree, prevTree?:RouteTree):void {
   this.name = curr.getParam('name');
   console.log('CountryDetailsComponent :: routerOnActivate', this.name);
   this._countryService.findCountry(this.name).subscribe(res => {
     this.country = res.json();
   });
 }
開發者ID:JeffJin,項目名稱:ngconf2016,代碼行數:7,代碼來源:country-details.component.ts

示例3: routerOnActivate

	routerOnActivate(routeSegment: RouteSegment): void {
		this.accountService.getAccount(routeSegment.getParam('accountId'))
			.subscribe((account: IAccount): IAccount => this.account = account);

		this.accountService.accountChanges
			.subscribe(updatedAccount => this.account = updatedAccount);
	}
開發者ID:SamGraber,項目名稱:BankGame,代碼行數:7,代碼來源:account.component.ts

示例4: routerOnActivate

 routerOnActivate(curr:RouteSegment, prev?:RouteSegment, currTree?:RouteTree, prevTree?:RouteTree):void {
   const id = Number(curr.getParam('id'));
   this._contactsService.getContact(id).subscribe(contact => this.contact = contact);
   this.baseSegments = currTree.parent(curr).urlSegments.map((x: UrlSegment) => x.segment);
   this.baseSegments.unshift('/');
   this.editSegments = this.baseSegments.concat(['edit']);
 }
開發者ID:yuxhuang,項目名稱:angular2-starter,代碼行數:7,代碼來源:contact-details.component.ts

示例5: constructor

 constructor(
   
   // private config: Config, 
   // private firebaseService: FirebaseService, 
   private routeSegment: RouteSegment) {
   
   // var fbUrl = config.get('firebaseUrl');
   
   // Grab the roomId from the uri
   this.roomId = routeSegment.getParam('id');
   
   var roomPath = `/rooms/${this.roomId}`;
   var gamePath = `/games/${this.roomId}`;
   var chatPath = `/chats/${this.roomId}`;
   var taskPath = '/queue/tasks';
   
   // this.$roomRef = firebaseService.getRef(roomPath);
   // this.$gameRef = firebaseService.getRef(gamePath);
   // this.$taskRef = firebaseService.getRef(taskPath);
   
   this.room = {};
   // this.roomUrl = `${fbUrl}${roomPath}`;
   // this.gameUrl = `${fbUrl}${gamePath}`;
   // this.chatUrl = `${fbUrl}${chatPath}`;
   this.loading = true;
 }
開發者ID:acrogame,項目名稱:acro-client,代碼行數:26,代碼來源:room.component.ts

示例6: routerOnActivate

    routerOnActivate(r: RouteSegment) : void {
        let id = r.getParam('id');
        // TODO: Remove mock and replace it with a call to the backend
        this.tournament = new Tournament();
        this.tournament.id = id;
        this.tournament.game = "MockGame";
        this.tournament.description = "MockDescription MockDescription MockDescription MockDescription MockDescription" +
            "MockDescription MockDescription MockDescription MockDescription MockDescription MockDescription MockDescription " +
            "MockDescription MockDescription MockDescription MockDescription MockDescription MockDescription MockDescription " +
            "MockDescription MockDescription MockDescription MockDescription MockDescription MockDescription MockDescription";
        this.tournament.name = "MockTournament";
        this.tournament.type = TournamentType.planning;
        this.tournament.playedGames = [];

        let user1 = new User();
        user1.firstname = "Max";
        user1.lastname  = "Mockman";
        user1.gender    = Gender.male;
        user1.id        = "abcde";
        user1.username  = "Mockuser1";
        let user2 = new User();
        user2.firstname = "Michele";
        user2.lastname  = "Mockwoman";
        user2.gender    = Gender.female;
        user2.id        = "cdefgh";
        user2.username  = "Mockuser2";
        this.tournament.participants = [user1, user2];
    }
開發者ID:Lacuno,項目名稱:Angular2Test,代碼行數:28,代碼來源:tournament.compontent.ts

示例7: routerOnActivate

    routerOnActivate(curr: RouteSegment) {
        this.curSegment = curr;

        let id = +curr.getParam('id');
        this.item = this.dataService.portfolioItems[id];
        console.log(this.item);
    }
開發者ID:satanworker,項目名稱:webpack-newangular-boilerplate,代碼行數:7,代碼來源:portfolioItemDetail.component.ts

示例8:

	ngOnInit(){
		this.artistId = this._routeSegment.getParam('id');
		this.provider = this._routeSegment.getParam('provider');
		
		this._artistService.getArtist(this.artistId, this.provider).then((artist: IArtist) =>{
			this.artist = artist;
		});
	}
開發者ID:dpix,項目名稱:PlayMeExtension,代碼行數:8,代碼來源:artistDetailsComponent.ts

示例9:

	ngOnInit() {
		var id = this._routeSegment.getParam('id');
		var provider = this._routeSegment.getParam('provider');

		this._albumService.getAlbum(id, provider).then((album: IAlbum) => {
			this.album = album;
		});
	}
開發者ID:dpix,項目名稱:PlayMeExtension,代碼行數:8,代碼來源:albumDetailsComponent.ts

示例10: sendNewMail

 public sendNewMail() {
     var email = this._routeSegment.getParam('email');
     this._authService.resendConfirmEmail(email)
         .subscribe(res => {
             console.log('New email sent');
         });
 }
開發者ID:,項目名稱:,代碼行數:7,代碼來源:


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