I'm writing a Angular Directive with typescript to able share a scope item, i create a interface that inherits from ng.IScope, but Visual Studio Code show this warning: "Property IScope dont exist on type IAngularStatic', I am using the angular.d.ts type definition file from definitelytyped.org.
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);
}
How i can share data from scope to my current directive ?
You wrote export interface IMenuDirective: ng.IScope {
. It should be export interface IMenuDirective extends ng.IScope {
. The compiler error is misleading.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments