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


TypeScript directivetest.compile函數代碼示例

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


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

示例1: beforeEach

		beforeEach((): void => {
			transactionStatus.compile({"transaction-status": "model"});
			transactionStatus.scope.$digest();
			isolateScope = transactionStatus["element"].isolateScope();
			sinon.stub(isolateScope, "clickHandler");
			transactionStatus["element"].triggerHandler("$destroy");
		});
開發者ID:scottohara,項目名稱:loot,代碼行數:7,代碼來源:status.ts

示例2: beforeEach

	beforeEach(inject((directiveTest: DirectiveTest): void => {
		ogFavourite = directiveTest;
		ogFavourite.configure("og-favourite", "i");
		ogFavourite.scope.model = {
			context: false,
			type: "test"
		};
		ogFavourite.compile({"og-favourite": "model"}, true);
	}));
開發者ID:scottohara,項目名稱:loot,代碼行數:9,代碼來源:og-favourite.ts

示例3: it

			it(`should do nothing when the ${key.name} key${key.ctrl ? "s are" : " is"} pressed and a ${key.handler} handler is not defined`, (): void => {
				event.keyCode = key.code;
				event.ctrlKey = key.ctrl;
				scope.model[key.handler] = null;
				ogTableNavigable.compile({"og-table-navigable": "model"});
				ogTableNavigable.scope.$digest();
				isolateScope = ogTableNavigable["element"].isolateScope();
				sinon.stub(isolateScope, "jumpToRow");
				isolateScope.focussedRow = 1;
				isolateScope.keyHandler(event as JQueryKeyEventObject);
				(event.preventDefault as SinonStub).should.have.been.called;
			});
開發者ID:scottohara,項目名稱:loot,代碼行數:12,代碼來源:og-table-navigable.ts

示例4: it

		it("should include a TD spanning the specified number of columns", (): void => {
			ogTableLoading.compile({
				"og-table-loading": "model",
				colspan: "3"
			}, true);
			ogTableLoading.scope.$digest();
			ogTableLoading["element"] = ogTableLoading["element"].find("tr");

			const td: JQuery<Element> = ogTableLoading["element"].find("td");

			td.should.not.be.empty;
			(td.attr("colspan") as string).should.equal("3");
		});
開發者ID:scottohara,項目名稱:loot,代碼行數:13,代碼來源:og-table-loading.ts

示例5: beforeEach

	beforeEach(inject((_$window_: angular.IWindowService, _$timeout_: angular.ITimeoutService, ogInputCurrencyControllerMock: OgInputCurrencyControllerMock, ogInputNumberControllerMock: OgInputNumberControllerMock, ogInputCurrencyDirective: OgInputCurrencyDirective[], ogInputNumberDirective: OgInputNumberDirective[], directiveTest: DirectiveTest): void => {
		$window = _$window_;
		$timeout = _$timeout_;

		// Swap the input currency/number directive controllers with the mock versions
		(ogInputCurrencyDirective[0] as angular.IDirective).controller = ogInputCurrencyControllerMock;
		(ogInputNumberDirective[0] as angular.IDirective).controller = ogInputNumberControllerMock;

		ogInputCalculator = directiveTest;
		ogInputCalculator.configure("og-input-calculator", "input");
		ogInputCalculator.compile({"og-input-currency": ""}, true);
		ogInputCalculator.scope.$digest();
		ogInputCalculator["element"] = ogInputCalculator["element"].find("input");
		scope = ogInputCalculator.scope as OgInputCalculatorScope;
	}));
開發者ID:scottohara,項目名稱:loot,代碼行數:15,代碼來源:og-input-calculator.ts

示例6: beforeEach

	beforeEach(inject((_$window_: angular.IWindowService, _$timeout_: angular.ITimeoutService, directiveTest: DirectiveTest): void => {
		$window = _$window_;
		$timeout = _$timeout_;
		ogInputAutoselect = directiveTest;
		ogInputAutoselect.configure("og-input-autoselect", "input");
		ogInputAutoselect.compile();
		scope = ogInputAutoselect.scope as OgInputAutoSelectScope;

		mockJQueryInstance = {
			select: sinon.stub()
		};

		realJQueryInstance = $window.$;
		$window.$ = sinon.stub();
		$window.$.withArgs(sinon.match((value: JQuery<Element>): boolean => value[0] === ogInputAutoselect["element"][0])).returns(mockJQueryInstance);
	}));
開發者ID:scottohara,項目名稱:loot,代碼行數:16,代碼來源:og-input-autoselect.ts

示例7: beforeEach

	beforeEach(inject((_$window_: angular.IWindowService, directiveTest: DirectiveTest, _ogTableNavigableService_: OgTableNavigableService): void => {
		$window = _$window_;
		ogTableNavigableService = _ogTableNavigableService_;
		ogTableNavigable = directiveTest;
		ogTableNavigable.configure("og-table-navigable", "table", "<tbody><tr ng-repeat=\"row in rows\"><td></td></tr></tbody>");
		scope = ogTableNavigable.scope as OgTableNavigableScope & {rows: {}[]; model: OgTableActions};
		scope.rows = [{}, {}];
		scope.model = {
			selectAction: sinon.stub(),
			cancelAction: sinon.stub(),
			insertAction: sinon.stub(),
			deleteAction: sinon.stub(),
			editAction: sinon.stub(),
			focusAction: sinon.stub()
		};
		ogTableNavigable.compile({"og-table-navigable": "model"});
		ogTableNavigable.scope.$digest();
		isolateScope = ogTableNavigable["element"].isolateScope();
	}));
開發者ID:scottohara,項目名稱:loot,代碼行數:19,代碼來源:og-table-navigable.ts

示例8: beforeEach

	beforeEach(inject((directiveTest: DirectiveTest): void => {
		ogLoadingSpinner = directiveTest;
		ogLoadingSpinner.configure("og-loading-spinner");
		ogLoadingSpinner.scope.model = "test message";
		ogLoadingSpinner.compile({"og-loading-spinner": "model"});
	}));
開發者ID:scottohara,項目名稱:loot,代碼行數:6,代碼來源:og-loading-spinner.ts

示例9: setup

	// Helper function in lieu of beforeEach (which we can't use for dynamically generated specs)
	function setup(scenario: {currentStatus: TransactionStatus, nextStatus: TransactionStatus, icon: "tag" | "lock", tooltip: string}): void {
		((transactionStatus.scope.model as DirectiveTestModel).transaction as Transaction).status = scenario.currentStatus;
		transactionStatus.compile({"transaction-status": "model"});
		transactionStatus.scope.$digest();
		isolateScope = transactionStatus["element"].isolateScope();
	}
開發者ID:scottohara,項目名稱:loot,代碼行數:7,代碼來源:status.ts


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