本文整理匯總了TypeScript中angular.IControllerService.default方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IControllerService.default方法的具體用法?TypeScript IControllerService.default怎麽用?TypeScript IControllerService.default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular.IControllerService
的用法示例。
在下文中一共展示了IControllerService.default方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: beforeEach
beforeEach(angular.mock.inject($injector => {
$controller = $injector.get("$controller");
$rootScope = $injector.get("$rootScope");
$q = $injector.get("$q");
downloadsService = $injector.get("DownloadsService");
$scope = $rootScope.$new(true);
spyOn(downloadsService, "getDownloads").and.callFake(() => {
const deferred: IDeferred<Array<IDownload>> = $q.defer();
deferred.resolve(TestDownloads);
return deferred.promise;
});
spyOn(downloadsService, "getCategories").and.callFake(() => {
const deferred: IDeferred<Array<string>> = $q.defer();
deferred.resolve(["Assembly Minutes", "ASC Minutes", "SR14"]);
return deferred.promise;
});
ctrl = $controller("DownloadsCtrl", {
$scope: $scope
});
}));
示例2: beforeEach
beforeEach(() => {
ctrl = $controller("PageEditorCtrl", {
$scope: $scope,
confirmModalService: confirmModalService,
RepoReloadModalService: repoReloadModalService
});
});
示例3: beforeEach
beforeEach(angular.mock.inject($injector => {
$controller = $injector.get("$controller");
$rootScope = $injector.get("$rootScope");
$scope = $rootScope.$new(true);
ctrl = $controller("CaPasswordConfirmationCtrl", {
$scope: $scope
});
ctrl.passwordConfirmationForm = {
$setPristine: () => {},
$pristine: true,
$dirty: false,
$valid: true,
$invalid: false,
$submitted: false,
$error: undefined,
$name: "fakeform",
$pending: undefined,
$addControl: () => {},
$removeControl: () => {},
$setValidity: () => {},
$setDirty: () => {},
$commitViewValue: () => {},
$rollbackViewValue: () => {},
$setSubmitted: () => {},
$setUntouched: () => {}
};
}));
示例4: beforeEach
beforeEach(angular.mock.inject($injector => {
$controller = $injector.get("$controller");
$rootScope = $injector.get("$rootScope");
$q = $injector.get("$q");
$scope = $rootScope.$new(true);
meetingService = $injector.get("MeetingService");
$uibModalInstance = { close: () => {}, dismiss: () => {} };
districts = [
{Area: "AREA1", AreaDescription: "Area 1 Desc", District: "DISTRICT1", DistrictDescription: "District 1 Desc"},
{Area: "AREA2", AreaDescription: "Area 2 Desc", District: "DISTRICT2", DistrictDescription: "District 2 Desc"},
{Area: "AREA3", AreaDescription: "Area 3 Desc", District: "DISTRICT3", DistrictDescription: "District 3 Desc"}
];
spyOn($uibModalInstance, "close");
spyOn(meetingService, "getDistricts").and.callFake(() => {
const deferred: IDeferred<any> = $q.defer();
deferred.resolve(districts);
return deferred.promise;
});
ctrl = $controller("DistrictModalInstanceCtrl", {
$scope: $scope,
$uibModalInstance: $uibModalInstance
});
}));
示例5: beforeEach
beforeEach(angular.mock.inject($injector => {
$controller = $injector.get("$controller");
$location = $injector.get("$location");
$rootScope = $injector.get("$rootScope");
$location = $injector.get("$location");
$q = $injector.get("$q");
loginService = $injector.get("LoginService");
alertModalService = $injector.get("AlertModalService");
$scope = $rootScope.$new(true);
$cookies = $injector.get("$cookies");
$localStorage = $injector.get("$localStorage");
$uibModal = $injector.get("$uibModal");
caLondonAppConfig = $injector.get("caLondonAppConfig");
caLondonAppConfig.UI_ENVIRONMENT = "UIDebug";
caLondonAppConfig.API_URL = "https://myurl.com/";
$cookies.remove("UIDebugEncodedAuth");
$localStorage.session = undefined;
session = $injector.get("SessionService");
ctrl = $controller("LoginCtrl", {
$scope: $scope
});
}));
示例6: initController
function initController(fieldName: string): void {
ctrl = $controller("SelectUploadModalInstanceCtrl", {
$scope: $scope,
$uibModalInstance: $uibModalInstance,
fieldName: fieldName
});
}
示例7:
(
$controller: IControllerService,
$rootScope: IRootScopeService,
_$state_: StateService,
_securityGroupReader_: SecurityGroupReader,
_confirmationModalService_: ConfirmationModalService,
_loadBalancerReader_: LoadBalancerReader,
) => {
$scope = $rootScope.$new();
$state = _$state_;
const app = ApplicationModelBuilder.createApplicationForTests('app', { key: 'loadBalancers', lazy: true });
app.loadBalancers.data.push(loadBalancer);
securityGroupReader = _securityGroupReader_;
confirmationModalService = _confirmationModalService_;
loadBalancerReader = _loadBalancerReader_;
controller = $controller('oracleLoadBalancerDetailCtrl', {
$scope: $scope,
loadBalancer: loadBalancer,
app: app,
$state: $state,
securityGroupReader: securityGroupReader,
loadBalancerReader: loadBalancerReader,
confirmationModalService: confirmationModalService,
});
},
示例8: beforeEach
beforeEach(angular.mock.inject($injector => {
$controller = $injector.get("$controller");
$rootScope = $injector.get("$rootScope");
$scope = $rootScope.$new(true);
$q = $injector.get("$q");
pageEditorService = $injector.get("PageEditorService");
$uibModalInstance = { close: () => {} };
const caPages: Array<IPageUpdateable> = [{
PageName: "whoismem",
ImportType: "Add"
},
{
PageName: "whatisca",
ImportType: "Add"
}];
const isIndividual: boolean = false;
ctrl = $controller("RepoReloadModalInstanceCtrl", {
$scope: $scope,
caPages: caPages,
isIndividual: isIndividual,
$uibModalInstance: $uibModalInstance
});
spyOn($uibModalInstance, "close");
}));
示例9: it
it("should reset password lifecycle", () => {
const newPasswordForm: IFormController = {
$setPristine: () => {},
$pristine: true,
$dirty: false,
$valid: true,
$invalid: false,
$submitted: false,
$error: undefined,
$name: "fakeform",
$pending: undefined,
$addControl: () => {},
$removeControl: () => {},
$setValidity: () => {},
$setDirty: () => {},
$commitViewValue: () => {},
$rollbackViewValue: () => {},
$setSubmitted: () => {},
$setUntouched: () => {}
};
ctrl = $controller("AccountSettingsCtrl", { $scope: $scope });
ctrl.newPasswordForm = newPasswordForm;
spyOn(newPasswordForm, "$setPristine");
ctrl.startChangingPassword();
expect(ctrl.passwordLifecycle.isSuccess).toEqual(false);
expect(ctrl.passwordLifecycle.isFailure).toEqual(false);
expect(ctrl.passwordLifecycle.isChanging).toEqual(true);
expect(ctrl.passwordLifecycle.isSubmitting).toEqual(false);
expect(newPasswordForm.$setPristine).toHaveBeenCalled();
});
示例10: fn
const initializeController = ((stage: any): TravisExecutionDetailsCtrl => {
$scope.stage = stage;
return $ctrl(TravisExecutionDetailsCtrl, {
$scope,
executionDetailsSectionService: { synchronizeSection: ({}, fn: () => any) => fn(), },
});
});