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?

2 Answers 2

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>
Sign up to request clarification or add additional context in comments.

Comments

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;
}

1 Comment

Good point to note. I'm using MeanJS so that's already included.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.