gaf-mobile
Version:
GAF mobile Web site
30 lines (27 loc) • 681 B
JavaScript
module('gafMobileApp')
.directive('greeter', function() {
return {
restrict: 'E',
templateUrl: 'components/greeter/greeter.html',
scope: {
name: '@',
},
transclude: true,
controllerAs: 'ctrl',
bindToController: true,
controller: function() {
var _this = this;
_this.greeter = function() {
var hour = new Date().getHours();
if (hour < 12) {
return 'Good morning';
} else if (hour >= 12 && hour <= 17) {
return 'Good afternoon';
} else {
return 'Good evening';
}
};
}
};
});
;
angular.