• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript angular.IControllerService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript angular.IDeferred类代码示例发布时间:2022-05-28
下一篇:
TypeScript angular.IComponentControllerService类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap