mzee99
mzee99

Reputation: 191

What does adding spaces inside double curly braces change?

In AngularJS, does adding spaces around the expression inside the double curly braces like this {{ expression }} rather than this {{expression}} change anything?

I'm currently going through this tutorial and this test doesn't pass when putting spaces, but by removing them, it passes.

Upvotes: 1

Views: 1854

Answers (3)

Ronel Gonzales
Ronel Gonzales

Reputation: 125

It doesn't matter if you have spaces in ng-bind view. (ng-bind view is the {{ }})

Upvotes: 0

Robin-Hoodie
Robin-Hoodie

Reputation: 4974

{{}} is just a shortcut for the ng-bind directive which sets up a one way binding between the controller and the view, spaces or not does not matter

Upvotes: 1

yangli-io
yangli-io

Reputation: 17334

It makes no difference apart from semantics, its the same as

['hello', 'world']
['hello','world']

Upvotes: 1

Related Questions