angularjs controller 怎么使用jquery
1个回答
2016-11-09 · 知道合伙人互联网行家
关注
展开全部
用的 resolve,应该还能跑,规不规范得另说...
when('/', templateUrl: '/assets/docatapp/templates/docs_view.html', controller: @DocsViewController, resolve: @DocsViewController.resolve)
@DocsViewController.resolve =
redirect: ($route, $location) ->
@path = $route.current.params.path
$location.url @path if @path?
data: ($q, $doCat, $route, $shared) ->
deferred = $q.defer()
unless @path?
params = $route.current.params
page = if params.page then params.page else 1
per = $shared.per()
$doCat.doc.query {page: page, per: per}, (data) ->
deferred.resolve(data)
deferred.promise
@DocsViewController = ($scope, $location, $routeParams, $shared, data) ->
...
when('/', templateUrl: '/assets/docatapp/templates/docs_view.html', controller: @DocsViewController, resolve: @DocsViewController.resolve)
@DocsViewController.resolve =
redirect: ($route, $location) ->
@path = $route.current.params.path
$location.url @path if @path?
data: ($q, $doCat, $route, $shared) ->
deferred = $q.defer()
unless @path?
params = $route.current.params
page = if params.page then params.page else 1
per = $shared.per()
$doCat.doc.query {page: page, per: per}, (data) ->
deferred.resolve(data)
deferred.promise
@DocsViewController = ($scope, $location, $routeParams, $shared, data) ->
...
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询