Update - I've also tried the excluding the single quotes around 'my-border'
altogether:
template: '<div class="col-xs-12" ng-class="{my-border:
hasBorder">...</div>'
But no luck. This is the error I get:
Error: [$parse:syntax] Syntax Error: Token '-' is unexpected, expecting
[:]...
I'd really appreciate your feedback! Thank you! :]
On Tuesday, April 8, 2014 5:13:26 PM UTC-7, Shannon wrote:
>
> Javascript:
> I have to do this in javascript, i can't do it in the html (at least not
> without breaking everything, i hope to put it out into the html later on).
>
> If it was in plain html, it would look like this:
> <div class="col-xs-12" ng-class="{'my-border': hasBorder">...</div>
>
> But since it's in javascript, the whole html line needs to be surrounded
> in single quotes:
> template: '<div class="col-xs-12" ng-class="{'my-border':
> hasBorder">...</div>'
>
> I've tried the following but only get syntax error: unexpected string
> template: '<div class="col-xs-12" ng-class="{"my-border":
> hasBorder">...</div>'
> template: '<div class="col-xs-12" ng-class="{\'my-border\':
> hasBorder">...</div>'
> template: '<div class="col-xs-12" ng-class="{'my-border':
> hasBorder">...</div>'
>
> I am new to this group, so I first searched the archives and didn't find
> anything.
> If anyone could help me out or link me to an existing topic, I would
> really appreciate it!
>
> Thank you so much for your time!!
>
> Shannon :]
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.