當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript IControllerService.default方法代碼示例

本文整理匯總了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
        });
    }));
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:25,代碼來源:downloads.controller.spec.ts

示例2: beforeEach

 beforeEach(() => {
     ctrl = $controller("PageEditorCtrl", {
         $scope: $scope,
         confirmModalService: confirmModalService,
         RepoReloadModalService: repoReloadModalService
     });
 });
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:7,代碼來源:page-editor.controller.spec.ts

示例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: () => {}
        };
    }));
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:29,代碼來源:ca-password-confirmation.controller.spec.ts

示例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
        });
    }));
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:27,代碼來源:district-modal-instance.controller.spec.ts

示例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
        });
    }));
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:26,代碼來源:login.controller.spec.ts

示例6: initController

 function initController(fieldName: string): void {
     ctrl = $controller("SelectUploadModalInstanceCtrl", {
         $scope: $scope,
         $uibModalInstance: $uibModalInstance,
         fieldName: fieldName
     });
 }
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:7,代碼來源:select-upload-modal.controller.spec.ts

示例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,
   });
 },
開發者ID:emjburns,項目名稱:deck,代碼行數:25,代碼來源:loadBalancerDetail.controller.spec.ts

示例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");
    }));
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:29,代碼來源:repo-reload-modal-instance.controller.spec.ts

示例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();
            });
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:34,代碼來源:account-settings.controller.spec.ts

示例10: fn

 const initializeController = ((stage: any): TravisExecutionDetailsCtrl => {
   $scope.stage = stage;
   return $ctrl(TravisExecutionDetailsCtrl, {
     $scope,
     executionDetailsSectionService: { synchronizeSection: ({}, fn: () => any) => fn(), },
   });
 });
開發者ID:brujoand,項目名稱:deck,代碼行數:7,代碼來源:travisExecutionDetails.controller.spec.ts


注:本文中的angular.IControllerService.default方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。