Is there a way to escape curly braces so they are ignored by AngularJS?

2,157 views
Skip to first unread message

James Moger

unread,
Jun 26, 2013, 12:02:26 PM6/26/13
to ang...@googlegroups.com
In my app I have data injected into a server-side generated page.  This data may have double or triple curly braces which is unrelated to AngularJS and should be presented exactly as it was injected.  Unfortunately, AngularJS is interpreting these brace-wrapped snippets and failing to bind them which breaks my client-side use of Angular.

Is there a way to escape my injected braced data so that Angular doesn't fail?

-J

Pawel Kozlowski

unread,
Jun 26, 2013, 1:15:13 PM6/26/13
to ang...@googlegroups.com
Hi!

http://docs.angularjs.org/api/ng.directive:ngNonBindable

is one way of doing it.

Cheers,
Pawel

On Wed, Jun 26, 2013 at 6:02 PM, James Moger <james...@gmail.com> wrote:
> Unfortunately, AngularJS is interpreting these brace-wrapped snippets and
> failing to bind them which breaks my client-side use of Angular.
>
> Is there a way to escape my injected braced data so that Angular doesn't
> fail?




--
AngularJS book:
http://www.packtpub.com/angularjs-web-application-development/book
Looking for bootstrap-based widget library for AngularJS?
http://angular-ui.github.com/bootstrap/

Dave Gruska

unread,
Jun 26, 2013, 1:38:31 PM6/26/13
to ang...@googlegroups.com
You can change the start/end symbols altogether, though this isn't necessarily ideal:

Dave

James Moger

unread,
Jun 26, 2013, 2:34:23 PM6/26/13
to ang...@googlegroups.com
Fantastic!  Thanks for the replies.!

I did stumble upon the start/end symbol change and I initially went with that (works great)... but perhaps the ng-non-bindable recommendation is the best practice?

-J
Reply all
Reply to author
Forward
0 new messages