Add taiga main controller preloading projects.
parent
00ff55be3e
commit
e68a1dc1b9
|
@ -26,10 +26,30 @@ bindOnce = @.taiga.bindOnce
|
||||||
module = angular.module("taigaBase", ["taigaLocales"])
|
module = angular.module("taigaBase", ["taigaLocales"])
|
||||||
|
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
## Global Page Controller
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
class MainTaigaController extends taiga.Controller
|
||||||
|
@.$inject = ["$scope", "$tgResources"]
|
||||||
|
|
||||||
|
constructor: (@scope, @rs) ->
|
||||||
|
promise = @.loadInitialData()
|
||||||
|
promise.then null, ->
|
||||||
|
console.log "FAIL"
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
loadInitialData: ->
|
||||||
|
return @rs.projects.list().then (projects) =>
|
||||||
|
console.log projects
|
||||||
|
@scope.projects = projects
|
||||||
|
return projects
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Global Page Directive
|
## Global Page Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
|
|
||||||
MainTaigaDirective = ($log, $compile, $rootscope) ->
|
MainTaigaDirective = ($log, $compile, $rootscope) ->
|
||||||
template = _.template("""
|
template = _.template("""
|
||||||
<h1 class="logo"><a href="" title="Home"><img src="/images/logo.png" alt="Taiga"/></a></h1>
|
<h1 class="logo"><a href="" title="Home"><img src="/images/logo.png" alt="Taiga"/></a></h1>
|
||||||
|
|
Loading…
Reference in New Issue