当前位置: 首页>>代码示例>>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;未经允许,请勿转载。