-
Notifications
You must be signed in to change notification settings - Fork 30
Template functions with annotations / ng-strict-di #11
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
Comments
Just pushed a fix for this, see 28ff08e This allows for: // Array annotations with minification
template: ['$element', '$attrs', function template(a, b) {
console.log(a, b); // $element, $attrs
return [
'<div class="counter">',
'<p>Counter component</p>',
'<input type="text" ng-model="counter.count">',
'<button type="button" ng-click="counter.decrement();">-</button>',
'<button type="button" ng-click="counter.increment();">+</button>',
'</div>'
].join('');
}] // No annotations with automated minification (see source code `isArray` ternary + annotations)
template: function template(a, b) {
console.log(a, b); // $element, $attrs
return [
'<div class="counter">',
'<p>Counter component</p>',
'<input type="text" ng-model="counter.count">',
'<button type="button" ng-click="counter.decrement();">-</button>',
'<button type="button" ng-click="counter.increment();">+</button>',
'</div>'
].join('');
} // Basic template String
template: [
'<div class="counter">',
'<p>Counter component</p>',
'<input type="text" ng-model="counter.count">',
'<button type="button" ng-click="counter.decrement();">-</button>',
'<button type="button" ng-click="counter.increment();">+</button>',
'</div>'
].join('') |
Thanks @toddmotto! Works great. 👍 |
@karlhorky Sweet! I've published |
@karlhorky FYI, I've just published |
💯 thanks, sounds good |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As per my GitHub comment in this angular.js issue, I'm running into issues with template functions with annotating or
ng-strict-di
.I know this issue may belong in the main angular.js repo, but I just wanted to ask, in case someone here had an idea how to get around this.
The text was updated successfully, but these errors were encountered: