mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
@@ -707,7 +707,7 @@ class SampleDirective implements ng.IDirective {
|
||||
restrict = 'A';
|
||||
name = 'doh';
|
||||
|
||||
compile(templateElement: ng.IAugmentedJQuery) {
|
||||
compile(templateElement: JQLite) {
|
||||
return {
|
||||
post: this.link
|
||||
};
|
||||
@@ -723,7 +723,7 @@ class SampleDirective implements ng.IDirective {
|
||||
class SampleDirective2 implements ng.IDirective {
|
||||
restrict = 'EAC';
|
||||
|
||||
compile(templateElement: ng.IAugmentedJQuery) {
|
||||
compile(templateElement: JQLite) {
|
||||
return {
|
||||
pre: this.link
|
||||
};
|
||||
@@ -741,7 +741,7 @@ angular.module('SameplDirective', []).directive('sampleDirective', SampleDirecti
|
||||
angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpolate', '$q', ($interpolate: ng.IInterpolateService, $q: ng.IQService) => {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: (scope: ng.IScope, el: ng.IAugmentedJQuery, attr: ng.IAttributes) => {
|
||||
link: (scope: ng.IScope, el: JQLite, attr: ng.IAttributes) => {
|
||||
$interpolate(attr['test'])(scope);
|
||||
$interpolate('', true)(scope);
|
||||
$interpolate('', true, 'html')(scope);
|
||||
@@ -869,7 +869,7 @@ angular.module('docsTimeDirective', [])
|
||||
}])
|
||||
.directive('myCurrentTime', ['$interval', 'dateFilter', ($interval: any, dateFilter: any) => {
|
||||
return {
|
||||
link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes) {
|
||||
link(scope: ng.IScope, element: JQLite, attrs: ng.IAttributes) {
|
||||
let format: any;
|
||||
let timeoutId: any;
|
||||
|
||||
@@ -916,7 +916,7 @@ angular.module('docsTransclusionExample', [])
|
||||
transclude: true,
|
||||
scope: {},
|
||||
templateUrl: 'my-dialog.html',
|
||||
link(scope: ng.IScope, element: ng.IAugmentedJQuery) {
|
||||
link(scope: ng.IScope, element: JQLite) {
|
||||
scope['name'] = 'Jeff';
|
||||
}
|
||||
};
|
||||
@@ -1017,7 +1017,7 @@ angular.module('docsTabsExample', [])
|
||||
scope: {
|
||||
title: '@'
|
||||
},
|
||||
link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) {
|
||||
link(scope: ng.IScope, element: JQLite, attrs: ng.IAttributes, tabsCtrl: any) {
|
||||
tabsCtrl.addPane(scope);
|
||||
},
|
||||
templateUrl: 'my-pane.html'
|
||||
@@ -1098,6 +1098,18 @@ angular.module('copyExample', [])
|
||||
$scope.reset();
|
||||
}]);
|
||||
|
||||
// Extending IScope for a directive, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/21160
|
||||
interface IMyScope extends angular.IScope {
|
||||
myScopeProperty: boolean;
|
||||
}
|
||||
|
||||
angular.module('aaa').directive('directive', () => ({
|
||||
link(scope: IMyScope) {
|
||||
console.log(scope.myScopeProperty);
|
||||
return;
|
||||
}
|
||||
}));
|
||||
|
||||
namespace locationTests {
|
||||
const $location: ng.ILocationService = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user