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
0
votes
1 answer

How do you retrieve a textbox entry in AngularJS using $scope and ng-bind

I'm currently dabbling with extending the Umbraco back office and for this I need to use Angular Js. It's going pretty well so far and I have hooked up a button that fires a request to a WebApi controller and returns a confirmation that a service…
jezzipin
  • 4,110
  • 14
  • 50
  • 94
0
votes
1 answer

ng-repeat / ng-bind wont show my data

The problem that i am getting is that my ng-repeat / ng-bind won't show the data inside $scope.articles. while in the console i get the data im expecting. I now made a code snippit so it's easier to discover the problem. var App =…
0
votes
2 answers

Putting value to hidden input and then getting it in POST variable

I am trying to get an input value with AngularJS from input field to another hidden input field (in another form in the same page) so I can transmit it later if user presses submit on the other form.

Name:

dreamoki
  • 43
  • 8
0
votes
4 answers

Issue displaying value in number field AngularJS

I am trying to bind a value which of type string when it comes from the controller in a numeric input field like the following: Since the detail.Value is of type string, I value is not getting displayed…
RandomUser
  • 1,843
  • 8
  • 33
  • 65
0
votes
2 answers

How to bind two input field in one span

I want to make a form for user that can fill in their first name and second name. I want to use angularjs. But I don't know how to bind two different input to one line. I tried this code without any success.
Voornaam:…
user3360123
  • 99
  • 10
0
votes
2 answers

Use regex on data and assign matches to new scope

I'm having trouble finding any examples of this, but it doesn't seem like it should be too difficult. Basically I have a $resource that returns JSON. In the controller I assign some different things to $scope from the data, for…
pram
  • 642
  • 1
  • 6
  • 13
0
votes
1 answer

How does ng-bind extract the $scope child from the attr value passed to it?

I'm trying to make a custom ng-directive that gets $scope.object.variable by the value passed to it as an $attribute - "object.variable" (just like ng-bind does) I couldn't understand how ng-bind does it by…
laggingreflex
  • 32,948
  • 35
  • 141
  • 196
0
votes
1 answer

Using ng-bind-html to assign a form?

I want to click a button to replace a variable with a form. How do I do this? JavaScript var MainCtrl = angular.module('mainCtrl', []); MainCtrl.controller('MainCtrl', function ($scope) { $scope.bar = 'Foo'; $scope.foo = function(){ …
A T
  • 13,008
  • 21
  • 97
  • 158
0
votes
1 answer

Issue with ng-model and ng-repeat, input value is duplicated on each form field on the page

I have a page where multiple forms are created based on ng-repeat. everything works fine until write something into the input and everything gets duplicated on all the other repeated forms input elements. I have used ng-model="Notify.message" which…
0
votes
1 answer

Using ng-attr within inserted html from ng-bind-html

How do you evaluate ng-attr for elements that have been inserted with ng-bind-html? JS Fiddle illustrating what I'm talking about here. HTML:
Puzzler3141
  • 1,682
  • 2
  • 14
  • 21
0
votes
1 answer

Wordpress working with angular bindings

Hi I have been working on this web application and I put this code http://jsbin.com/quponase/3/edit into a wordpress page and it stopped working. I have been trying to not use the double curly braces and instead use ng-bind since I read wordpress…
Chad Watkins
  • 531
  • 1
  • 8
  • 23
0
votes
1 answer

How to bind a templateUrl to an element

I want to do something like this:
Is there any way to do this?
Martin
  • 1,283
  • 2
  • 14
  • 28
0
votes
1 answer

angularjs ng-click breacks after second click

to show you my problem, here a link http://codepen.io/destroy90210/pen/adbCy if you click on the button the first time it fades up and the form will be shown, if i click on reset then the form get closed, but now if i want to open it again nothing…
Gregor Voinov
  • 2,203
  • 7
  • 34
  • 52
-1
votes
1 answer

How can we find x-path expression for class ng-binding?

How can we find x-path expression for class ng-binding? Here is the example:
Freedom Kuota Harian 1GB / Hari (28GB)
-1
votes
1 answer

how could i get event fire when ng-click

i m adding an anchor tag with ng-click with the ng-bind-html template but the ng-click is not triggering... i need a solution triggering the function. my template: $scope.res =$scope.res+'
user3812457
  • 157
  • 1
  • 2
  • 13
1 2 3
12
13