From 462a3e448eb05053ef82c28dc825e218d67ca71e Mon Sep 17 00:00:00 2001 From: Jough Dempsey Date: Tue, 13 Dec 2016 17:13:06 -0600 Subject: [PATCH] Add ReadonlyArray as an alterative type for $inject. It may be prudent to make injected dependencies immutable, but we can't Object.freeze() or use the Readonly interfae for our dependency array if $inject only accepts a mutable array of strings. --- angular/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/angular/index.d.ts b/angular/index.d.ts index 4b85c4a804..4a9445962d 100644 --- a/angular/index.d.ts +++ b/angular/index.d.ts @@ -10,7 +10,7 @@ declare var angular: angular.IAngularStatic; // Support for painless dependency injection declare global { interface Function { - $inject?: string[]; + $inject?: string[] | ReadonlyArray; } } @@ -1205,7 +1205,7 @@ declare namespace angular { debugInfoEnabled(): boolean; debugInfoEnabled(enabled: boolean): ICompileProvider; - + /** * Sets the number of times $onChanges hooks can trigger new changes before giving up and assuming that the model is unstable. * Increasing the TTL could have performance implications, so you should not change it without proper justification. @@ -1214,7 +1214,7 @@ declare namespace angular { */ onChangesTtl(): number; onChangesTtl(limit: number): ICompileProvider; - + /** * It indicates to the compiler whether or not directives on comments should be compiled. * It results in a compilation performance gain since the compiler doesn't have to check comments when looking for directives. @@ -1223,7 +1223,7 @@ declare namespace angular { */ commentDirectivesEnabled(): boolean; commentDirectivesEnabled(enabled: boolean): ICompileProvider; - + /** * It indicates to the compiler whether or not directives on element classes should be compiled. * It results in a compilation performance gain since the compiler doesn't have to check element classes when looking for directives.