Created
April 14, 2013 08:48
-
-
Save ysyun/5381991 to your computer and use it in GitHub Desktop.
angular module code sample
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
'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