Related to that question: Jade Mixins in AngularJS
I have the following (simplified) code:
tr(ng-repeat="avatar in avatars")
+avatarRow({name: '{{avatar.name}}'})
mixin avatarRow(avatar)
td avatar.name
Since it is a bit dirty to resolve the "avatar" object before it is passed to the mixin I would prefer a more angular like solution.
Still it would be cool, to keep the mixin code in the same file, but thats not a must. As far as I see, with ngInclude
I can no pass any args. So how to handle that?
Continued with this:
tr(ng-repeat="avatar in avatars")
+avatarRow({name: '{{avatar}}'})
mixin avatarRow(avatar)
var x = JSON.parse(avatar);
td x.name
I checked that typeof avatar is string, I can even print it and pass the result to JSON.parse() myself but jade throws a SyntaxError:
Unexpected token {
at Object.parse (native)