本文整理汇总了TypeScript中angular.IRootScopeService.%24new方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IRootScopeService.%24new方法的具体用法?TypeScript IRootScopeService.%24new怎么用?TypeScript IRootScopeService.%24new使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular.IRootScopeService
的用法示例。
在下文中一共展示了IRootScopeService.%24new方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(angular.mock.inject($injector => {
$controller = $injector.get("$controller");
$rootScope = $injector.get("$rootScope");
$q = $injector.get("$q");
manageUsersService = $injector.get("ManageUsersService");
$scope = $rootScope.$new(true);
alertModalService = $injector.get("AlertModalService");
$uibModal = $injector.get("$uibModal");
spyOn($uibModal, "open");
spyOn(alertModalService, "show");
testUser = {
UserName: "testusercom",
GroupName: "agroup",
Email: "some@email.com",
EmailConfirmed: true,
UserRoles: []
};
testUser2 = {
UserName: "testusercom2",
GroupName: "agroup2",
Email: "some2@email.com",
EmailConfirmed: true,
UserRoles: []
};
}));
示例2: 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: () => {}
};
}));
示例3: beforeEach
beforeEach(angular.mock.inject($injector => {
$controller = $injector.get("$controller");
$rootScope = $injector.get("$rootScope");
$compile = $injector.get("$compile");
$q = $injector.get("$q");
$scope = $rootScope.$new(true);
downloadsService = $injector.get("DownloadsService");
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<ICategory>> = $q.defer();
deferred.resolve(TestCategories);
return deferred.promise;
});
component = angular.element(`<downloads></downloads>`);
$compile(component)($scope);
ctrl = component.controller("downloads");
$scope.$digest();
}));
示例4:
(
$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,
});
},
示例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: 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");
}));
示例7: 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
});
}));
示例8: 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
});
}));
示例9: function
function () {
let $scope = $rootScope.$new()
$scope.data = angular.copy(mockData)
let ganttElement = $compile('<div gantt data="data"><gantt-tree></gantt-tree></div>')($scope)
$scope.$digest()
$timeout.flush()
// Set the data in tree view ordering
let orderedData = $scope.data.slice()
let indices = {}
angular.forEach($scope.data, function (rowModel, i) {
if (rowModel.name) {
indices[rowModel.name] = i
}
})
/*jshint sub:true */
let configRow = orderedData[indices['Config']]
let setupRow = orderedData[indices['Setup']]
let serverRow = orderedData[indices['Server']]
orderedData[indices['Setup']] = serverRow
orderedData[indices['Config']] = setupRow
orderedData[indices['Server']] = configRow
/*jshint sub:false */
checkLabels(orderedData, ganttElement)
}
示例10: function
function () {
let $scope = $rootScope.$new()
let ganttElement = $compile('<div gantt></div>')($scope)
$scope.$digest()
$timeout.flush()
checkData([], ganttElement)
})