Skip to content

Instantly share code, notes, and snippets.

@jcarley
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcarley/e9b1fa8a68991ef42bcd to your computer and use it in GitHub Desktop.
Save jcarley/e9b1fa8a68991ef42bcd to your computer and use it in GitHub Desktop.
Angular Controller in Coffeescript
# Generated source: http://goo.gl/Cf2swp
do ->
angular
.module('app.dashboard')
.run ['routehelper', (routehelper) ->
routehelper.configureRoutes(getRoutes())
]
getRoutes = ->
[
url: '/'
config:
templateUrl: '/app/dashboard/dashboard.html'
title: 'dashboard'
controller: 'Dashboard'
controllerAs: 'vm'
settings:
nav: 1
content: '<i class="happy"></i>Dashboard'
]
do ->
angular
.module('app.dashboard')
.controller('Dashboard', Dashboard)
# Dashboard.$inject = ['common', 'dataservice']
### @ngInject ###
class Dashboard
constructor: (common, dataservice) ->
@logger = common.logger
@$q = common.$q
cancel: ->
@logger.log('hi')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment