Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i use ng-model with <p> tag?

Tags:

angularjs

I am new to angular-js and i think this is a basic question how to get the value from a paragraph tag in angular-js? I tried with using ng-model but doesn't giving the value.Can anyone help me?

like image 584
sparrow Avatar asked Dec 24 '22 12:12

sparrow


1 Answers

ng-model is working for two way binding. p tag is not supported for ng-model. if you want to bind p tag then you can use ng-bind or {{}}.

<p ng-bind="test"></p>

plunker code here with ng-bind

like image 73
Durgpal Singh Avatar answered Jan 04 '23 20:01

Durgpal Singh