2016-06-11 16:48:07 +02:00
|
|
|
###
|
|
|
|
# here we do stuff
|
|
|
|
###
|
|
|
|
angular.module "tkApp", []
|
2016-06-11 16:59:40 +02:00
|
|
|
.controller("MainCtrl", ($scope, $http)->
|
2016-06-11 16:48:07 +02:00
|
|
|
|
|
|
|
###
|
|
|
|
# scoped variables
|
|
|
|
###
|
|
|
|
$scope.demo = 'WOHOOO angular ça marche'
|
|
|
|
|
2016-06-11 16:59:40 +02:00
|
|
|
$http.get('json/squares.json').then( (data)->
|
|
|
|
$scope.config = data.data
|
|
|
|
)
|
2016-06-11 16:48:07 +02:00
|
|
|
###
|
|
|
|
# scoped functions
|
|
|
|
###
|
|
|
|
$scope.doStuff = ->
|
|
|
|
console.log('impressig!')
|
|
|
|
$scope.doStuffWithArg = (arg)->
|
|
|
|
console.log('wow such function!', arg)
|
|
|
|
|
|
|
|
###
|
|
|
|
# initilise everything
|
|
|
|
###
|
|
|
|
$scope.init = ->
|
|
|
|
console.log('mainCtrl initialised');
|
|
|
|
$scope.init()
|
|
|
|
)
|