热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

angular.elemnt(BTN-ID)。html的()。我没有定义-angular.elemnt(btn-id).html().Iamgettingundefined

Ihaveajsfileonsamplescriptssample.jsandthereare8htmlfilesonsamplesrctemplates
  • I have a js file on sample/scripts/sample.js and there are 8 html files on sample/src/templates/ .html .
  • 我在sample / scripts / sample.js上有一个js文件,在sample / src / templates / .html上有8个html文件。

  • I wanted to select a button on one of the html file.
  • 我想在其中一个html文件上选择一个按钮。

  • I tried angular.elemnt(btn-id).html(). I am getting undefined. I am doing wrong?
  • 我试过angular.elemnt(btn-id).html()。我没有定义。我做错了?

angular.elemnt(btn-id).html()

  • I wanted to change the text of button according the condition
  • 我想根据条件更改按钮的文本

1 个解决方案

#1


0  

You have element spelled wrong, but angular.element is not used to return element references. You want to use document.getElementById().

元素拼写错误,但angular.element不用于返回元素引用。您想使用document.getElementById()。

https://docs.angularjs.org/api/ng/function/angular.element


推荐阅读
author-avatar
为什么不嫩注册
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有