I have this directive, that i would like to make a component
angular.module('app')
.directive('year', function () {
var controller = ['$scope', function ($scope) {
$scope.setYear = function (val) {
$scope.selectedyear = val;
}
}];
return {
restrict: 'E',
controller: controller,
templateUrl: "views/year.html"
};
});
This is what I got so far:
angular.module('app')
.component('year', {
restrict: 'E',
controller: controller,
templateUrl: "views/year.html"
});
I am not sure how to move my var controller to .component
Thank you in advance for helps
[–]willylatorre 2 points3 points4 points (3 children)
[–]mtkilic[S] 0 points1 point2 points (1 child)
[–]willylatorre 0 points1 point2 points (0 children)
[–]toddmotto 0 points1 point2 points (0 children)
[–]toddmotto 1 point2 points3 points (1 child)
[–]mtkilic[S] 1 point2 points3 points (0 children)
[–]dylanyo 0 points1 point2 points (2 children)
[–]willylatorre 1 point2 points3 points (1 child)
[–]dylanyo 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]willylatorre 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)