user6579134 user6579134 - 7 months ago 44
AngularJS Question

place localstorage value in a textbox from a controller with angularjs

I have a localstorage value which i would want to put in it a texfield from a controller

.controller('working_ctrl', ['$scope', '$http', '$location', function ($scope, $http,$location) {
$scope.user= localStorage.getItem("user")
$scope.items = [];
$scope.selected = undefined;
method: 'GET',
}).then(function (data) {
$scope.items =;



<div ng-controller="working_ctrl" ng-repeat="s in items| limitTo:1">
<input name="quantity" type="text" id="quantity" ng-model="s.quantity">
<input name="user" type="text" id="user" ng-model="s.user">


You can bind the $scope.user to that textbox

<input name="user" type="text" id="user" ng-model="user">