javascript - Input value not showing up (AngularJS) -
i've got controller:
app.controller('controlformulario', function($scope) { this.formulario = []; this.formulario.fecha = new date(); });
...this directive:
app.directive('formulario', [function() { return { restrict: 'e', // c: class, e: element, m: comments, a: attributes templateurl: 'modules/formulario.html' };
... , view:
<div class="form-group"> <label for="fecha">fecha</label> <input type="fecha" class="form-control" id="fecha" ng-model="fecha" value="{{formctrl.formulario.fecha | date}}" disabled> </div>
as may guess, attribute value has date, filtered , so. no problem here. actual problem comes when see website, , find out input doesn't show anything. "value" attribute assigned, it's not showing inside input box.
why? doing wrong? tried same ng-init, ng-value... i'm newbye on angularjs, ended basic tutorial , i'm trying practise , more knowledge, maybe i'm missing out something.
any help?
you need store data attribute $scope.
check out link: https://docs.angularjs.org/guide/scope
Comments
Post a Comment