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


TypeScript Router.generate方法代碼示例

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


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

示例1: params

 /**
  * This function initializes attributes.
  * You probably don't need to touch this method.
  * If the last element is detected as a function,
  * _preFunction is initialized.
  * @param {any[]} changes - inputs value, don't 
  * worry about it.
  */
 set params(changes: any[]) {
   if(typeof(changes[changes.length-1]) === "function") {
     this._preFunction = changes.pop();
   }
   this._routeParams = changes;
   this._navigationInstruction = this._router.generate(this._routeParams);
 }
開發者ID:xzry6,項目名稱:customizedRouterLink,代碼行數:15,代碼來源:wasabi-router-link.ts

示例2: createDossier

    public createDossier(customer) {
        const instructions = this._router.generate(['/Customer', {
            id: customer.partnerId
        }]);

        const caption = `Kunde: ${customer.vorname} ${customer.name}`;
        const dossiers = this._dossierService.getAll();
        const dossier = dossiers.find(d => d.caption === caption);

        if (!dossier) {
            this._dossierService.createDossier(instructions, caption);
        }
    }
開發者ID:LVM-IT,項目名稱:spa-prototype,代碼行數:13,代碼來源:list.ts

示例3: navigateToMailbox

    public navigateToMailbox() {
        this._interactionService.requestSave();

        let caption = 'Briefkasten',
            instructions = this._router.generate(['/Mailbox']);

        const dossiers = this._dossierService.getAll();
        const dossier = dossiers.find(d => d.caption === caption);

        if (!dossier) {
            this._dossierService.createDossier(instructions, caption);
        }

        this._router.navigateByInstruction(instructions);

    }
開發者ID:LVM-IT,項目名稱:spa-prototype,代碼行數:16,代碼來源:appmenu.ts

示例4: isRouteActive

 isRouteActive(pRoute:String){
   let instruction = this._router.generate([pRoute]);
   return this._router.isRouteActive(instruction);
 }
開發者ID:APROTEC,項目名稱:Web-Application,代碼行數:4,代碼來源:navbarAssociate.component.ts

示例5: isCurrentRoute

    isCurrentRoute(routeName){
        var instruction = this._router.generate(routeName);

        return this._router.isRouteActive(instruction);
    }
開發者ID:kzzzz,項目名稱:kzzzz-ng2,代碼行數:5,代碼來源:navbar.component.ts

示例6: params

 set params(changes: any[]) {
     this._routeParams = changes;
     this._navigationInstruction = this._router.generate(this._routeParams);
 }
開發者ID:ImNitinNayar7,項目名稱:nativescript-angular,代碼行數:4,代碼來源:ns-router-link.ts

示例7: navigatePage

 navigatePage(id) {
   let instruction = this.router.generate(['../PostsPage', { id: id }]);
   this.router.navigateByInstruction(instruction);
 }
開發者ID:kentoo,項目名稱:ng2-wp-blog,代碼行數:4,代碼來源:posts.component.ts

示例8: isCurrentRoute

 isCurrentRoute(route) {
   // obsolete in current version, use RouterLinkActive directive!
   // https://angular.io/docs/ts/latest/api/router/index/RouterLinkActive-directive.html
   var instruction = this._router.generate(route);
   return this._router.isRouteActive(instruction);
 }
開發者ID:fox-eye,項目名稱:ng-project,代碼行數:6,代碼來源:navbar.component.ts

示例9: isCurrentRoute

 isCurrentRoute(route){//get current route
   var instruction = this._router.generate(route);
   return this._router.isRouteActive(instruction);
 }
開發者ID:valmassoi,項目名稱:udemy-angular-2-tutorial,代碼行數:4,代碼來源:app.component.ts

示例10: isRouteActive

	isRouteActive(route) {
		var instruction = this._router.generate([route]);
		return this._router.isRouteActive(instruction);
	}
開發者ID:vediga,項目名稱:angular2-blog-app,代碼行數:4,代碼來源:my-app-navbar.component.ts


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