Last active
August 29, 2015 14:24
-
-
Save jcarley/e9b1fa8a68991ef42bcd to your computer and use it in GitHub Desktop.
Angular Controller in Coffeescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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