2

Think I'm missing something simple here but here's my issue:

 <h4 ng-bind="example.heading">
  <small ng-bind="example.subheading"></small>
 </h4>

Doesn't work - if ng-bind replaces the content inside the tag, then would I have to use the {{}} syntax instead? Like so,

<h4>{{example.heading}}<small ng-bind="example.subheading"></small></h4>

I like the idea of the brackets not flashing up briefly so I picked ng-bind. Is there another way around this?

Arulkumar
  • 12,966
  • 14
  • 47
  • 68
Mr Office
  • 290
  • 1
  • 9

2 Answers2

3

To prevent the brackets from flashing, use ng-cloak to hide compiling Angular:

<body ng-controller="myCtrl" ng-cloak>
    <h4>{{example.heading}}<small ng-bind="example.subheading"></small></h4>
</body>
tymeJV
  • 103,943
  • 14
  • 161
  • 157
0

ng-cloack is the solution.

Dont forget to add the following css if you want to use it

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
    display: none !important;
}
Polochon
  • 2,199
  • 13
  • 13