【问题标题】:how to add new scope to angularjs reusable templates如何向 angularjs 可重用模板添加新范围
【发布时间】:2013-04-17 21:41:11
【问题描述】:

我想创建一个可重复使用的模板,用

说联系信息
<input> name
<input> telephone
<input> email

现在,我想在很多情况下使用这个部分 html。因此,我将在一个示例中填充输入以进行编辑,或者在另一个示例中添加新联系人。最好的方法是什么?

【问题讨论】:

    标签: angularjs scope reusability


    【解决方案1】:

    用户 angularjs 指令。这正是它的设计目的。 http://docs.angularjs.org/guide/directive

    这是一个有用的资源,可帮助您开始使用指令:https://github.com/angular/angular.js/wiki/JsFiddle-Examples#version-110

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-24
      相关资源
      最近更新 更多