I am trying to port an existing angular application to typescript (version 1.5.3):
Here is the code:
'use strict'; angular.module('x') .directive('tabsPane', TabsPane) function TabsPane(itemTabs) { return { restrict: 'E', compile: compileTabs }; function compileTabs(tElement) { var template = createTabsTemplate();
When I compile javascript, I get:
error TS2345: argument of type '(itemTabs: any) => {restrict: string; compile: (tElement: any) => void; } 'is not assigned to a parameter of type "any []". The 'push' property is not in the type '(itemTabs: any) => {restrict: string; compile: (tElement: any) => void; } ".
I tried to understand why he complains about this, I came to the definition of typescript angular:
Somehow typescript implies this definition
directive (name: string, inlineAnnotatedFunction: any []): IModule;
where the following definition would be more appropriate:
directive (name: string, directiveFactory: IDirectiveFactory): IModule;
I am completely new to typescript, so I assume that I am doing something wrong, but I cannot find anything related to google.
source share