本文整理匯總了TypeScript中angular.IScope.%24broadcast方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IScope.%24broadcast方法的具體用法?TypeScript IScope.%24broadcast怎麽用?TypeScript IScope.%24broadcast使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular.IScope
的用法示例。
在下文中一共展示了IScope.%24broadcast方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: encodeURIComponent
() => {
$state.go('portal.home');
$rootScope.$broadcast('graviteeUserRefresh', {});
$rootScope.$broadcast('graviteeUserCancelScheduledServices');
let userLogoutEndpoint = $window.localStorage.getItem("user-logout-url");
$window.localStorage.removeItem("user-logout-url");
if (userLogoutEndpoint != undefined) {
var redirectUri = encodeURIComponent(window.location.origin + (window.location.pathname == '/' ? '' : window.location.pathname));
$window.location.href= userLogoutEndpoint + redirectUri;
}
}
示例2:
this.ApiService.deploy(api.id).then((deployedApi) => {
this.NotificationService.show("API deployed");
this.api = deployedApi.data;
this.api.etag = deployedApi.headers('etag');
this.api.picture_url = api.picture_url;
this.apiJustDeployed = true;
this.$rootScope.$broadcast("apiChangeSuccess", {api: this.api});
});
示例3:
this.$onInit = () => {
if ($state.current.name === 'management.settings') {
$rootScope.$broadcast('reduceSideNav');
SidenavService.setCurrentResource('SETTINGS');
for ( let entry of _.keys(this.settingsMenu)) {
if (this.settingsMenu[entry].perm) {
$state.go(this.settingsMenu[entry].goTo);
break;
}
}
}
};
示例4:
this.UserService.current().then( (user) => {
if (provider.userLogoutEndpoint) {
this.$window.localStorage.setItem("user-logout-url", provider.userLogoutEndpoint);
}
this.$rootScope.$broadcast('graviteeUserRefresh', {'user' : user});
let route = this.RouterService.getLastRoute();
if (route.from && route.from.name !== '' && route.from.name !== 'logout' && route.from.name !== 'confirm') {
this.$state.go(route.from.name, route.fromParams);
} else {
this.$state.go('portal.home');
}
});
示例5:
this.toggleReducedMode = () => {
this.reducedMode = !this.reducedMode;
$window.localStorage.setItem(reduceModeKey, this.reducedMode);
$rootScope.$broadcast('onWidgetResize');
};
示例6: step
getDefinitions().then((defs) => {
extend(vm, {
active: 'titan',
i18nClassNames: _.object(
['titan', 'hunter', 'warlock'],
_.sortBy(Object.values(defs.Class), (classDef) => classDef.classType).map(
(c) => c.className
)
),
i18nItemNames: _.object(
['Helmet', 'Gauntlets', 'Chest', 'Leg', 'ClassItem', 'Artifact', 'Ghost'],
[45, 46, 47, 48, 49, 38, 39].map((key) => defs.ItemCategory.get(key).title)
),
activesets: '5/5/2',
type: 'Helmet',
scaleType: 'scaled',
progress: 0,
fullMode: false,
includeVendors: false,
showBlues: false,
showExotics: true,
showYear1: false,
allSetTiers: [],
hasSets: true,
highestsets: {},
activeHighestSets: [],
ranked: {},
activePerks: {},
excludeditems: [],
collapsedConfigs: [false, false, false, false, false, false, false, false, false, false],
lockeditems: {
Helmet: null,
Gauntlets: null,
Chest: null,
Leg: null,
ClassItem: null,
Artifact: null,
Ghost: null
},
lockedperks: {
Helmet: {},
Gauntlets: {},
Chest: {},
Leg: {},
ClassItem: {},
Artifact: {},
Ghost: {}
},
setOrderValues: ['-str_val', '-dis_val', '-int_val'],
lockedItemsValid(droppedId: string, droppedType: ArmorTypes) {
droppedId = getId(droppedId);
if (alreadyExists(vm.excludeditems, droppedId)) {
return false;
}
const item = getItemById(droppedId, droppedType)!;
const startCount: number = item.isExotic && item.type !== 'ClassItem' ? 1 : 0;
return (
startCount +
(droppedType !== 'Helmet' && vm.lockeditems.Helmet && vm.lockeditems.Helmet.isExotic
? 1
: 0) +
(droppedType !== 'Gauntlets' &&
vm.lockeditems.Gauntlets &&
vm.lockeditems.Gauntlets.isExotic
? 1
: 0) +
(droppedType !== 'Chest' && vm.lockeditems.Chest && vm.lockeditems.Chest.isExotic
? 1
: 0) +
(droppedType !== 'Leg' && vm.lockeditems.Leg && vm.lockeditems.Leg.isExotic ? 1 : 0) <
2
);
},
excludedItemsValid(droppedId: string, droppedType: ArmorTypes) {
const lockedItem = vm.lockeditems[droppedType];
return !(lockedItem && alreadyExists([lockedItem], droppedId));
},
onSelectedChange(prevIdx, selectedIdx) {
if (vm.activeCharacters[prevIdx].class !== vm.activeCharacters[selectedIdx].class) {
vm.active = vm.activeCharacters[selectedIdx].class;
vm.onCharacterChange();
vm.selectedCharacter = selectedIdx;
}
},
onCharacterChange() {
vm.ranked = getActiveBuckets(
buckets[vm.active],
vendorBuckets[vm.active],
vm.includeVendors
);
vm.activeCharacters = D1StoresService.getStores().filter((s) => !s.isVault);
const activeStore = D1StoresService.getActiveStore()!;
vm.selectedCharacter = _.findIndex(
vm.activeCharacters,
(char) => char.id === activeStore.id
);
vm.activePerks = getActiveBuckets(
perks[vm.active],
vendorPerks[vm.active],
//.........這裏部分代碼省略.........
示例7: tickMethod
function tickMethod(): void {
ctrl.game.Update();
CheckAllItemsAffordability();
$scope.$broadcast('tick');
// $scope.$digest();
}
示例8:
this.UserService.save(this.user).then((response) => {
this.user = response.data;
this.$rootScope.$broadcast('graviteeUserRefresh');
this.$scope.formUser.$setPristine();
this.NotificationService.show("User has been updated successfully");
});