Last active
August 29, 2015 13:56
-
-
Save dgageot/9071458 to your computer and use it in GitHub Desktop.
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
angular.module 'myapp', [] | |
.controller 'DemoController', class | |
constructor: (@$location) -> | |
@field = 'Field' | |
method: -> | |
'Method' | |
methodWithParam: (param) -> | |
"Param: #{param}" | |
accessFieldFromMethod: -> | |
"Path: #{@$location.absUrl()}" |
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
<!DOCTYPE html> | |
<html lang="en" ng-app="myapp"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> | |
<script src="app.coffee"></script> | |
</head> | |
<body ng-controller="DemoController as demo"> | |
<p>{{demo.field}}</p> | |
<p>{{demo.method()}}</p> | |
<p>{{demo.methodWithParam('param1')}}</p> | |
<p>{{demo.accessFieldFromMethod()}}</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment