You're not referencing your value anywhere.
HTML
------------------
<div ng-controller="tripsheetTotal">
<input ng-model="tripSheetTotal" type="text">
</div>
JS
-------------------
var tripsheetBuilder = angular.module('tripsheetBuilder ',[]);
tripsheetTotal.controller('tripsheetTotal', function ($scope){
var input = ["1", "2", "7"]; //Test for array, you want to pull your db
array to this controller.
$scope.tripSheetTotal = input.length;
});
On Friday, May 30, 2014 3:02:54 PM UTC-5, Rohit Kumar wrote:
>
> <div>
> <input ng-model="tripsheet.tripsheet_num" type="text"> </div>
>
> JS
>
> $scope.getTotalTripsheets = function()
> {
> return $scope.tripsheets.length;
> };
>
> i want the above data(getTotalTripsheets) to to default input in the input
> tag, in the above code i am fetching the length from the database table and
> tried making it as the default data in the input field.
>
> i tried somthing like this(below), it dos not work, how should i proceed
> with this?
>
> $scope.tripsheet = {}
> $scope.tripsheet.tripsheet_num = getTotalTripsheets
> ;
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.