本文整理汇总了TypeScript中angular2/router.RouteData类的典型用法代码示例。如果您正苦于以下问题:TypeScript RouteData类的具体用法?TypeScript RouteData怎么用?TypeScript RouteData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RouteData类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(params: RouteParams
, data: RouteData
) {
this.productID = params.get('id');
console.log("Is this prod environment?" + data.get('isProd'));
}
示例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();
}
}
示例3: constructor
constructor(public params:RouteParams, data: RouteData) {
this.productID = params.get('id');
console.log(`Is this prod environment: ${data.get('isProd')}`);
}
示例4: constructor
constructor(private _data: RouteData, private router: Router) {
this.options = _data.get('options');
}
示例5: constructor
constructor(
private routeData: RouteData) {
this.isEditRoute = routeData.get('isEditRoute')
}
示例6: constructor
constructor (private routeParams: RouteParams, private routeData: RouteData) {
this.message = this.routeParams.get('message');
this.data = this.routeData.get('passedData');
}
示例7: constructor
constructor(routeData: RouteData) {
this.count = routeData.get('count');
this.books = routeData.get('books');
}
示例8: constructor
constructor(params: RouteParams, data: RouteData){
this.id = params.get('id');
console.log(data.get('project'));
}
示例9: constructor
constructor(private _params: RouteParams, private _data: RouteData){
this.name = _params.get('name');
this.age = +_params.get('age');
this.data = _data.get('inside');
}