【发布时间】:2013-09-16 07:09:01
【问题描述】:
我找不到替代解决方案,可以说我在 jquery 中有这段代码:
$.get 'file.json', (re) ->
for k, v in re
tpl = "<div>{{v.content}}</div>";
$ '#container'.append tpl
.done () ->
impress().init()
这很好用,因为.done 仅在 ajax 之后执行代码,但 angular 似乎没有 .done 之类的,而 impress().init() 在加载内容时无法重新初始化,因此会有一个数据绑定错误..
这是我对角度的尝试
App.controller 'SomeCtrl', ($scope, $http) ->
$http.get('file.json')
.success (res) ->
$scope.slides = res
#what could possibly be in here
【问题讨论】:
标签: javascript jquery angularjs coffeescript