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


TypeScript RouteData.get方法代碼示例

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


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

示例1: constructor

    constructor(params: RouteParams
        , data: RouteData
    ) {
        this.productID = params.get('id');

        console.log("Is this prod environment?" + data.get('isProd'));
    }
開發者ID:yuvagit,項目名稱:Angular2,代碼行數:7,代碼來源:product_param.ts

示例2: constructor

    constructor(private http:Http,private router:Router,private form: FormBuilder,private routeParams:RouteParams,routeData: RouteData) {
        this.customer = {};
        this.nbErrors = 0;
        this.isEdition = routeData.get('isEdition');

        this.customerForm = form.group({
            firstName: ['', Validators.required],
            lastName: ['', Validators.required]
        });

        this.customerForm.valueChanges.subscribe(() => {
            if(this.customerForm.errors) {
                this.nbErrors = Object.keys(this.customerForm.errors).length;
            }
        });

        if(this.isEdition) {
            this.getCustomer();
        }
    }
開發者ID:kamfasage,項目名稱:angular-spring-dynamic-form,代碼行數:20,代碼來源:customer.ts

示例3: constructor

    constructor(public params:RouteParams, data: RouteData) {
        this.productID = params.get('id');

        console.log(`Is this prod environment: ${data.get('isProd')}`);
    }
開發者ID:israa-ia1205702,項目名稱:Examples,代碼行數:5,代碼來源:router-example.ts

示例4: constructor

 constructor(private _data: RouteData, private router: Router) {
     this.options = _data.get('options');
 }
開發者ID:Domcik8,項目名稱:clubby,代碼行數:3,代碼來源:tabs.component.ts

示例5: constructor

 constructor(
     private routeData: RouteData) {
     this.isEditRoute = routeData.get('isEditRoute')
 }
開發者ID:Ellipizle,項目名稱:angular2-redux-complex-ui,代碼行數:4,代碼來源:image-detail-row.ts

示例6: constructor

 constructor (private routeParams: RouteParams, private routeData: RouteData) {
   this.message = this.routeParams.get('message');
   this.data = this.routeData.get('passedData');
 }
開發者ID:HilmiDEV,項目名稱:augury,代碼行數:4,代碼來源:router-data1.ts

示例7: constructor

 constructor(routeData: RouteData) {
   this.count = routeData.get('count');
   this.books = routeData.get('books');
 }
開發者ID:adamayres,項目名稱:peeps2,代碼行數:4,代碼來源:book.ts

示例8: constructor

 constructor(params: RouteParams, data: RouteData){
     this.id = params.get('id');
     console.log(data.get('project'));
 }
開發者ID:2947721120,項目名稱:angular-2-samples,代碼行數:4,代碼來源:about.ts

示例9: constructor

  constructor(private _params: RouteParams, private _data: RouteData){
      this.name = _params.get('name');
      this.age =  +_params.get('age');
      this.data = _data.get('inside');

  }
開發者ID:lokeshjain2008,項目名稱:angular2Trial,代碼行數:6,代碼來源:hero-child.ts


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