Skip to content

Instantly share code, notes, and snippets.

@ysyun
Created April 14, 2013 08:48
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 ysyun/5381991 to your computer and use it in GitHub Desktop.
Save ysyun/5381991 to your computer and use it in GitHub Desktop.
angular module code sample
'use strict';
var app = angular.module('eggheadioApp');
app.controller('MainCtrl', function ($scope) {
$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];
}) ;
app.factory('Data', function() {
return {message: 'shared data'}
});
app.filter('reverse', function(Data) {
return function(text) {
return text.split("").reverse().join("");
}
});
//function DowonCtrl($scope, Data){
// $scope.data = Data;
//}
//
//function YoungCtrl($scope, Data){
// $scope.data = Data;
//
// $scope.reverse = function(message){
// return message.split("").reverse().join("");
// }
//}
app.controller('DowonCtrl', function ($scope, Data) {
$scope.data = Data;
})
.controller('YoungCtrl', function ($scope, Data) {
$scope.data = Data;
$scope.reverseMessage = function(message){
return message.split("").reverse().join("");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment