A
A
Alexey2014-10-23 09:01:51
JavaScript
Alexey, 2014-10-23 09:01:51

How to add data stored in $scope using jQuery?

How can jQuery or AngularJS add data that is stored in $scope? I have a table, links are stored in the first column, when you click on the link, under this line the table should be loaded with data from the database that I saved to the $scope?...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Luxurious, 2014-10-23
@oshikuru

If when you click on the link your data is already in $scope - use the add. variable.
Let's say you already have a layout for this data, you just put it in the right place and put ng-show="circumstance", and when loading the data, make $scope.circumstance = true.
Well, do not forget to use ng-binding or ng-model, on occasion.
Usage example:
in the controller body:

$http.get('/some/data/').success(function(loadedData){
    $scope.scopeData = loadedData;
    ...
    $scope.successLoad = true;
})

in layout:
<input type="text" ng-model="scopeData" ng-show="successLoad"></input>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question