本文整理匯總了TypeScript中angular.IScope.%24watchGroup方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IScope.%24watchGroup方法的具體用法?TypeScript IScope.%24watchGroup怎麽用?TypeScript IScope.%24watchGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular.IScope
的用法示例。
在下文中一共展示了IScope.%24watchGroup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: VendorCurrenciesCtrl
function VendorCurrenciesCtrl(this: IController, $scope: IScope, $filter) {
'ngInject';
const vm = this;
$scope.$watchGroup(['vm.vendorCategories', 'vm.propertyFilter'], () => {
const allCurrencies = {};
const vendorTabItems = $filter('vendorTabItems');
const allItems = vendorTabItems(
flatMap(vm.vendorCategories, (category: any) => {
if (!vm.propertyFilter || !vm.propertyFilter.length || category[vm.propertyFilter]) {
return category.saleItems;
}
return undefined;
}),
vm.propertyFilter
);
allItems.forEach((saleItem) => {
saleItem.costs.forEach((cost) => {
allCurrencies[cost.currency.itemHash] = cost.currency;
});
});
vm.currencies = allCurrencies;
});
}
示例2: initDateRange
private initDateRange(): void {
this.startDate = moment().startOf('week').toDate();
this.endDate = moment().endOf('week').toDate();
this.$scope.$watchGroup([
() => this.startDate,
() => this.endDate,
], this.onDateRangeChanged.bind(this));
}