It's working fine when I type something in the input field but I couldn't get the input value from the front end when the input has the default value.
I use Input::get()
to cacth the value
<input type="text" class="form-control" value="name" id="name" name="name" placeholder="Your name" ng-model="name"/>
I use AngularJs to bind the value from the database then pass it to ng-model
for the display default value on the input. However, I couldn't get the default value
This is my submit button
<input type="submit" name="student" ng-model="student" ng-click="submit()" novalidate value="Sync Sale" class="btn btn-primary" ng-</input>
If you want to define the input value of an input. You should check the ng-value directive of Angular.
Here's an example from the angular doc :
<label ng-repeat="name in names" for="{{name}}">
{{name}}
<input type="radio"
ng-model="my.favorite"
ng-value="name"
id="{{name}}"
name="favorite">
</label>
You can try it out whith this plunker if you want to : https://plnkr.co/edit/?p=preview
If u want get input value from input tag use AngularJS directive ng-model
.
The ng-model
directive binds the value of HTML controls (input, select, textarea) to application data.
for eg:-
<div ng-app="myApp" ng-controller="myCtrl">
Name: <input ng-model="name">
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.name = "John Doe";
});
</script>