I'm working on creating an Angular Directive using TypeScript to share a scope item. I created an interface that inherits from ng.IScope, but Visual Studio Code is showing me a warning: "Property IScope does not exist on type IAngularStatic". I am using the angular.d.ts type definition file from definitelytyped.org.
https://i.stack.imgur.com/fgZf2.jpg
module kingApp.Directives {
export interface IMenuDirective: ng.IScope {
}
export function MenuDirective(): ng.IDirective
{
return {
templateUrl: 'shared/menu/menu.html',
controller: Controllers.Home.HomeController
}
}
angular.module("kingApp").directive('menu',MenuDirective);
}
What is the best way to share data from scope to my current directive?