How to create a Month / Year date format
I have developed the code below, and it is not going through the consoles menus, that is, it is not entering the link:
Note: you are not giving any errors on the console.
<div class="form-group">
<label class="control-label">Faz aniversário entre (Mês/Ano)</label>
<div class="row">
<div class=" col-sm-7">
<div class="input-group">
<span class="input-group-addon"><i class="material-icons">today</i></span>
<input class="form-control" ng-model="state.filtro.dataInicialAniversario" placeholder="de" formatDateMesAno />
</div>
</div>
<div class="col-sm-5">
<input class="form-control" ng-model="state.filtro.dataFinalAniversario" placeholder="até" formatDateMesAno />
</div>
</div>
</div>
angular.module("app").directive('formatDateMesAno', directiveFormatMesAno);
function directiveFormatMesAno() {
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, elem, attr, modelCtrl) {
console.log(scope);
console.log(elem);
console.log(attr);
console.log(modelCtrl);
}
};