本文整理汇总了TypeScript中angular.IScope类的典型用法代码示例。如果您正苦于以下问题:TypeScript IScope类的具体用法?TypeScript IScope怎么用?TypeScript IScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IScope类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: FindArtifactFromExecutionCtrl
mock.inject(($rootScope: IScope) => {
$scope = $rootScope.$new();
initializeController = (stage: any) => {
$scope = $rootScope.$new();
$scope.stage = stage;
ctrl = new FindArtifactFromExecutionCtrl($scope);
};
}),
开发者ID:spinnaker,项目名称:deck,代码行数:8,代码来源:findArtifactFromExecution.controller.spec.ts
示例2:
export function subscribeOnScope<T>(
$scope: IScope,
observable: Observable<T>,
subscribeFn: (T) => void
): Subscription {
const subscription = observable.subscribe(subscribeFn);
$scope.$on('$destroy', () => subscription.unsubscribe());
return subscription;
}
开发者ID:bhollis,项目名称:DIM,代码行数:9,代码来源:rx-utils.ts
示例3: describe
describe('Controller: ChaosMonkeyExceptions', () => {
let $componentController: IComponentControllerService,
$ctrl: ChaosMonkeyExceptionsController,
$scope: IScope,
$q: IQService;
const initializeController = (data: any) => {
$ctrl = $componentController(
'chaosMonkeyExceptions',
{ $scope: null, $q },
data,
) as ChaosMonkeyExceptionsController;
};
beforeEach(mock.module(CHAOS_MONKEY_EXCEPTIONS_COMPONENT));
beforeEach(
mock.inject(
(_$componentController_: IComponentControllerService, _$q_: IQService, $rootScope: IRootScopeService) => {
$scope = $rootScope.$new();
$componentController = _$componentController_;
$q = _$q_;
},
),
);
describe('data initialization', () => {
it('gets all accounts, then adds wildcard and regions per account to vm', () => {
const accounts: any = [
{ name: 'prod', regions: [{ name: 'us-east-1' }, { name: 'us-west-1' }] },
{ name: 'test', regions: [{ name: 'us-west-2' }, { name: 'eu-west-1' }] },
];
spyOn(AccountService, 'listAllAccounts').and.returnValue($q.when(accounts));
initializeController(null);
$ctrl.application = ApplicationModelBuilder.createApplicationForTests('app', {
key: 'serverGroups',
loader: () => $q.resolve([]),
onLoad: (_app, data) => $q.resolve(data),
});
$ctrl.application.serverGroups.refresh();
$scope.$digest();
$ctrl.config = new ChaosMonkeyConfig($ctrl.application.attributes.chaosMonkey || {});
$ctrl.$onInit();
$scope.$digest();
expect($ctrl.accounts).toEqual([accounts[0], accounts[1]]);
expect($ctrl.regionsByAccount).toEqual({
prod: ['*', 'us-east-1', 'us-west-1'],
test: ['*', 'us-west-2', 'eu-west-1'],
});
});
});
});
开发者ID:emjburns,项目名称:deck,代码行数:57,代码来源:chaosMonkeyExceptions.component.spec.ts
示例4: it
it('prunes variables from the config if they no longer exist on the template', () => {
const spy = spyOn(PipelineTemplateReader, 'getPipelineTemplateFromSourceUrl');
spy.and.callFake(() => $q.resolve(templateB));
ctrl.initialize();
$scope.$digest();
ctrl.pipelineTemplateConfig = ctrl.buildConfig();
spy.and.callFake(() => $q.resolve(templateA));
ctrl.initialize();
$scope.$digest();
expect(ctrl.buildConfig().config.pipeline.variables).toEqual({
letters: ['a', 'b', 'c'],
});
});
开发者ID:mizzy,项目名称:deck,代码行数:17,代码来源:configurePipelineTemplateModal.controller.spec.ts
示例5: subscribeOnScope
subscribeOnScope($scope, isPhonePortraitStream(), (isPhonePortrait) => {
$scope.$apply(() => {
console.log('isPhonePortrait', isPhonePortrait);
vm.placeholder = isPhonePortrait
? t('Header.FilterHelpBrief')
: t('Header.FilterHelp', { example: 'is:dupe' });
});
});
开发者ID:bhollis,项目名称:DIM,代码行数:8,代码来源:search-filter.component.ts
示例6:
public $onInit(): void {
const { $scope, $rootScope, ClusterFilterModel, clusterFilterService, app } = this;
this.sortFilter = ClusterFilterModel.sortFilter;
this.tags = ClusterFilterModel.tags;
if (app.serverGroups.loaded) {
this.initialize();
}
app.serverGroups.onRefresh($scope, () => this.initialize());
$scope.$on('$destroy', $rootScope.$on('$locationChangeSuccess', () => {
ClusterFilterModel.activate();
clusterFilterService.updateClusterGroups(app);
}));
}
开发者ID:brujoand,项目名称:deck,代码行数:17,代码来源:clusterFilter.component.ts
示例7: 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));
}
开发者ID:lunches-platform,项目名称:fe,代码行数:9,代码来源:date-range-selector.component.ts
示例8: it
it('should use "aws" as the default provider if the requested provider cannot be found and there is no default set', () => {
let provider = '';
CloudProviderRegistry.registerProvider('fakeProvider', config);
providerService.selectProvider(application, 'securityGroup').then(_provider => {
provider = _provider;
});
$scope.$digest();
expect(provider).toBe('aws');
});
开发者ID:mizzy,项目名称:deck,代码行数:9,代码来源:providerSelection.service.spec.ts
注:本文中的angular.IScope类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论