Angularjs 1.2:在重复中包含模板 [英] Angularjs 1.2: include template in repeat

查看:26
本文介绍了Angularjs 1.2:在重复中包含模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 angularjs (1.2) 的最新版本,现在看来我无法在转发器中包含模板:

I am moving to the last version of angularjs (1.2), and now it seems that i cant include templates in the repeater:

http://plnkr.co/edit/K7n9sNhXe4z99VMSqTlk?p=preview

我可以将指令与 templateUrl 一起使用,但有没有办法仅使用 ng-include 来做到这一点?

I can use directive with templateUrl but is there a way to do this with ng-include only ?

谢谢.

注意:这适用于最新的稳定 angularjs 版本 (1.0.7)

Note: this works with the latest stable angularjs version (1.0.7)

编辑:每个重复元素上的​​错误日志(最新的 Chrome 版本):

EDIT: Error log (latest Chrome version) on each repeat element:

TypeError: Cannot call method 'insertBefore' of null
    at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:3321:22
    at forEach (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:199:18)
    at Object.enter (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:3320:9)
    at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:15947:24
    at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:6277:11
    at wrappedCallback (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:9042:59)
    at wrappedCallback (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:9042:59)
    at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:9128:26
    at Object.Scope.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:9953:28)
    at Object.Scope.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.js:9809:23)

推荐答案

spooky-giraffe (v 1.2) 不是生产版本.在 docs.angularjs.org 页面中找到的许多 jsfiddle 和 plunker 示例不再工作,因为这些示例自动更新到版本 1.2.

spooky-giraffe (v 1.2) is not a production release. Many of the jsfiddle and plunker examples found in the docs.angularjs.org pages no longer work since those examples auto-updated to version 1.2.

1.2 版中有许多功能更新和错误修复,包括对 ngAnimate 的完全重写,但在它成为稳定版本之前还有很多工作要做.

There are many feature updates and bug fixes in version 1.2, including a complete rewrite of ngAnimate, but still much work to be done before it becomes a stable release.

这篇关于Angularjs 1.2:在重复中包含模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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