AngularJS - Choose item from a form and create list

0

Hello

I have a json file with items, I need a form that when entering one of the items, it is loaded into a list along with the other information of that item and is saved in a list in the view. I have the form that when entering the item this appears with the remaining information, just do not know how to add it in a list that will not go away when consulting another item. Here is my attempt:

js and html:

app.controller('ArqCtrl', function($scope, $http) {
    $http.get("arquivo.json").success(function(response) {
        console.log(response);
        $scope.cidade = response;
    });
 
});
<md-content id="content">
    <div class="well">
        <br>
        <label>Search:<input type="text" ng-model="one" placeholder="Type" required></label>
     </div>
   
    <table>
        <thead>
            <th>Cidade</th>
            <th>pais</th>
            <th>telefone</th>
          
        </thead>
        <tbody>
            <tr ng-repeat="cid in cidade | filter: {name:one}">
            <td>{{cid.name}}</td>
            <td>{{cid.pais}}</td>
            <td>{{cid.telefone}}</td>
            </tr>
        </tbody>
    </table>
</md-content>

   
    
asked by anonymous 12.11.2018 / 14:11

0 answers