Questions tagged [ng-bind]

The ngBind attribute tells Angular to replace the text content of the specified HTML element with the value of a given expression, and to update the text content when the value of that expression changes. Typically, you don't use ngBind directly, but instead you use the double curly markup like {{ expression }} which is similar but less verbose.

Source: http://docs.angularjs.org/api/ng.directive:ngBind

The ngBind attribute tells Angular to replace the text content of the specified HTML element with the value of a given expression, and to update the text content when the value of that expression changes.

Typically, you don't use ngBind directly, but instead you use the double curly markup like {{ expression }} which is similar but less verbose.

It is preferrable to use ngBind instead of {{ expression }} when a template is momentarily displayed by the browser in its raw state before Angular compiles it. Since ngBind is an element attribute, it makes the bindings invisible to the user while the page is loading.

An alternative solution to this problem would be using the ngCloak directive.

Usage

as attribute

<ANY ng-bind="{expression}">
   ...
</ANY>

as class

<ANY class="ng-bind: {expression};">
   ...
</ANY>
  • Parameters

    ngBind – {expression} – Expression to evaluate.

183 questions
2
votes
1 answer

Change ng-bind and ng-model dynamically

i need help. I have a project and i need duplicate html nodes dynamically. Those nodes have ng-bind and ng-model attributes like this: I…
2
votes
2 answers

data-ng-bind from $scope controller

I'm lost, could you help me? I have a value in the $scope which is retrieved from JSON file: in Controller: $scope.scopeTitle = title; in JSON file: "title": "fruit.ID || 'Empty'" The fruit.ID is retrieved from backend, and I want to display it's…
kamyk
  • 295
  • 8
  • 25
2
votes
1 answer

Angular Google Map flikering issue (ng-cloak, ng-bind is not working!)

I'm having trouble with flikering problem in Angular Google Map. I have a problem in this Plunker. http://plnkr.co/edit/f2gxG7DM1U8IlOXfRiuT?p=preview When I click the marker, infowindow is flikering before it shows the information. I tried…
KimCrab
  • 2,231
  • 4
  • 15
  • 20
2
votes
1 answer

How to use ngBind with multiple filters in Angular

I have a ngModel data.type which is bound and I want to apply a filter actionType to it first and then add a prefix and then finally pass it to localize filter. Something like:

RandomQuestion
  • 6,778
  • 17
  • 61
  • 97

2
votes
1 answer

How to bind input type='date' with angularjs

so I am trying to bind value for input of type date.. Here is my AngularJS code that I am trying to bind the value to: $scope.date = new Date(); $scope.dateString = dateFilter($scope.date,'dd-MM-yyyy'); And html:
uksz
  • 18,239
  • 30
  • 94
  • 161
2
votes
1 answer

AngularJS "debounce" for ngBind

For ngModel there is a ngModelOptions such as ng-model-options="{ debounce: 1000 }" Is there something similar for ngBind or {{}} ? Basically, I am binding some data to a div element using ng-bind and as the default behavior of Angular.js, data…
Temp O'rary
  • 5,366
  • 13
  • 49
  • 109
2
votes
1 answer

Difference between ng-bind, ng-bind-html, ng-bind-html-unsafe in AngularJS?

I want to know difference between ng-bind, ng-bind-html and ng-bind-html-unsafe. Also when I run below code, I am getting error which is as mentioned below : Code : <%@ page language="java" contentType="text/html; charset=ISO-8859-1" …
Ravi Jiyani
  • 919
  • 1
  • 10
  • 26
2
votes
2 answers

Links not working in ng-bind-html

I am using ng-bind-html but the links in the to binding html won't work. This is the code for binding the content:
bergben
  • 1,385
  • 1
  • 16
  • 35
2
votes
3 answers

AngularJS table interface

I am trying to find the best way to display tabular data using AngularJS based on three RESTful data endpoints. For example, the data is comprised of three models: Roommate id name Chore id name ChoreAssignment id day roommate (fk) chore (fk) I…
Ryan Allen
  • 5,414
  • 4
  • 26
  • 33
2
votes
2 answers

AngularJS nested ng-bind on elements

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

Doesn't work - if ng-bind replaces the content inside the tag, then would I have to use the {{}}…
Mr Office
  • 290
  • 1
  • 9
2
votes
3 answers

Does dynamically adding ng-bind directive not work?

I'm adding the attribute ng-bind='data' to an element through a directive myApp.directive('myDiv', function() { return { restrict: 'E', link: function($scope, element, attrs) { element.html('
laggingreflex
  • 32,948
  • 35
  • 141
  • 196
1
vote
1 answer

unable bind using ng-bing in Angularjs

Trying to insert HTML content on the page using ng bind as below but unable to bind it. Script: SS_Mod_App.controller("SS_Ctrl",/*"$interpolate",*/ function ($scope, $http, $location, $window, $sce/*, $interpolate*/) { $scope.dates =…
1
vote
1 answer

Append value to translation token with ng-bind

I'm trying to iterate through an element 5 times. For that I'm using ng-repeat with a track by $index. After that I would like to use the value from $index to add to a translation token. This index value is appended to the token and then it fetches…
Cláudio Ribeiro
  • 1,509
  • 3
  • 37
  • 65
1
vote
1 answer

Angular changing button text on click

I am working on a game where I need to let the user choose the next level upon completion of the previous level. This can go on up to level 7. I need to be able to change the text on the button to indicate the next label number up to 7. So, in the…
Niraj
  • 333
  • 1
  • 5
  • 23
1
vote
1 answer

D3js / AngularJS - drag and data bind the rect's coordinates

I want to bind the coordinate x ,y of rect.(Recorded as "Coordinate "). And drag the rect, hoping that the record (coordinate x ,y) will synchronous change. Below are part of the code.(Complete code jsbin) html …
FJF
  • 125
  • 1
  • 2
  • 11