AngularJS Tip: ngBind

Today while reading AngularJS documentation I came accross the ngBind directive. I learned that ngBind is the same as using the {{}} expression. The only difference I found is that when using <h1>{{name}}</h1> you might see the same curly brackets before Angular replaces them with the model value. By using <h1 ng-bind="name"></h1> you don't see anything in the browser before it's rendered by Angular. So if you don't want the curly brackets to be displayed on the page then use ngBind, otherwhise use {{}} since there is not other difference between them.

Edgar Pino

About Edgar Pino

I’m a passionate software engineer. I currently work at Envano Interactive on application backends, server management, and finding solutions to technological challenges our clients face.