-1

I am using angular in my app and text appears for a second as this {{user.name}}, people told me to use ng-model, so am using <span ng-model="user.name"></span> but it's not showing anything. What should I do? Note: Beginner here.

Brittany Rutherford
  • 555
  • 1
  • 5
  • 15

1 Answers1

0

The span element is readonly. You need an input type for two-way binding, which is what the ng-model directive is providing you.

Instead, you can utilize the ng-cloak directive to hide the content prior to the template compiling.

Example:

<span ng-cloak>{{user.name}}</span>
Michael G
  • 6,695
  • 2
  • 41
  • 59