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


TypeScript angular.IControllerService類代碼示例

本文整理匯總了TypeScript中angular.IControllerService的典型用法代碼示例。如果您正苦於以下問題:TypeScript IControllerService類的具體用法?TypeScript IControllerService怎麽用?TypeScript IControllerService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了IControllerService類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

 (
   $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

示例2: describe

describe("LitOutOfStockModalInstanceCtrl", () => {
    let ctrl: LitOutOfStockModalInstanceCtrl;
    let $controller: IControllerService, $rootScope: IRootScopeService, $scope: IScope, $uibModalInstance: {close: Function};

    beforeEach(() => angular.mock.module(LITERATURE_MODULE));

    beforeEach(angular.mock.inject($injector => {
        $controller = $injector.get("$controller");
        $rootScope = $injector.get("$rootScope");
        $scope = $rootScope.$new(true);

        $uibModalInstance = { close: () => {} };

        const outOfStockItems = [{Item : 1}, {Item : 2}];

        ctrl = $controller("LitOutOfStockModalInstanceCtrl", {
            $scope: $scope,
            outOfStockItems: outOfStockItems,
            $uibModalInstance: $uibModalInstance
        });

        spyOn($uibModalInstance, "close");
    }));

    it("should instantiate correctly", () => {
        expect($uibModalInstance.close).not.toHaveBeenCalled();
        expect(ctrl.outOfStockItems).toEqual([{Item : 1}, {Item : 2}]);
    });

    it("#ok should close dialog", () => {
        ctrl.ok();

        expect($uibModalInstance.close).toHaveBeenCalled();
    });
});
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:35,代碼來源:lit-out-of-stock-modal-instance.controller.spec.ts

示例3: describe

describe("CaMapModalButtonCtrl", () => {
    let ctrl: CaMapModalButtonCtrl;
    let $controller: IControllerService, $rootScope: IRootScopeService, $scope: IScope, $uibModal: IModalService;

    beforeEach(() => angular.mock.module(COMMON_MODULE));

    beforeEach(angular.mock.inject($injector => {
        $controller = $injector.get("$controller");
        $rootScope = $injector.get("$rootScope");
        $uibModal = $injector.get("$uibModal");
        $scope = $rootScope.$new(true);

        ctrl = $controller("CaMapModalButtonCtrl", {
            $scope: $scope
        });
    }));

    it("should launch map modal", () => {
        spyOn($uibModal, "open");

        ctrl.open();

        expect($uibModal.open).toHaveBeenCalledWith({
            template: require("./map-modal-instance.tpl.html"),
            controller: "MapModalInstanceCtrl",
            controllerAs: "vm",
            resolve: {
                item: jasmine.any(Function)
            }
        });
    });
});
開發者ID:disco-funk,項目名稱:ca-london-angular,代碼行數:32,代碼來源:ca-map-modal-button.controller.spec.ts

示例4: 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

示例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: 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

示例7: 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

示例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: 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

示例10: 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


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