-
Notifications
You must be signed in to change notification settings - Fork 138
Update uiSref input type to match functionality #943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Was updating our code to try to use strict templates and was noting failures on templates that has been working for years. Noticed that the inputtype to `uiSref` is "string" when it works just fine with a declaration or object too, since the internal uses all support StateOrName.
@@ -87,7 +87,7 @@ export class UISref implements OnChanges { | |||
* <a uiSref="hoome">Home</a> | |||
* ``` | |||
*/ | |||
@Input('uiSref') state: string; | |||
@Input('uiSref') state: StateOrName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be changed on line 125 too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused? L125 in this file?
angular/src/directives/uiSref.ts
Line 125 in a34d95a
@Inject(UIView.PARENT_INJECT) parent: ParentUIViewInject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, typo. I meant Line 135
/** @internal */
set uiSref(val: string) { // here
this.state = val;
this.update();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I suppose so? But I can't really find anywhere this internal method is being used tbh? Was thinking it was for testing or maybe something angular-hybrid does, but I can't find anywhere we're uiSref
is given a value on the class directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do believe the setter is how the data-binding is applied
@Input('uiSref') state: StateOrName;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm well the decorator should bind the directive input "uiSref" to the class property "state". But nevertheless, whatever it's use, the setter should have the same type as the value it sets, I've updated it.
Was updating our code to try to use strict templates and was noting failures on templates that has been working for years. Noticed that the inputtype to
uiSref
is "string" when it works just fine with a declaration or object too, since the internal uses all support StateOrName.