0

Already I read many things about ng-model and ng-bind but still i m not satisfied with this

Code statement 1:

ng-model="table.process_data.username"

Code statement 2:

ng-bind="table.process_data.username"

i think both statements works are same? if i m wrong then plese help me to understand this thing

Urvi_204
  • 2,308
  • 2
  • 10
  • 23

1 Answers1

0

ng-bind is same as string interpolation not the same as ng-model. ng-model is used for 2 way databinding and ng-bind is only for one way databinding.

if you have written a variable in ng-model , any change in html will always be available in controller as well and vice versa , however this is not the case with ng-bind.

Consider ng-bind as string interpolation {{}} , its functionality is same as string interpolation.

vertika
  • 1,284
  • 1
  • 8
  • 22