我可以将ng-model与< p>一起使用吗?标签? [英] Can i use ng-model with <p> tag?

查看:36
本文介绍了我可以将ng-model与< p>一起使用吗?标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是angular-js的新手,我认为这是一个基本问题,如何从angular-js的段落标签中获取值?我尝试使用ng-model,但没有给出值.有人可以帮助我吗?

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?

推荐答案

ng-model 用于双向绑定. ng-model 不支持p标签.如果要绑定p标签,则可以使用 ng-bind {{}} .

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>

此处带有ng-bind的插件代码

这篇关于我可以将ng-model与&lt; p&gt;一起使用吗?标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆