Browse JSON angularjs

0

How to recover the username property with angularjs

{
    "results": [
        {
            "login": {
                "username": "organickoala334",
                "password": "bird",
                "salt": "m1r70kGo",
                "md5": "5f87dcbf6bb1740be5df3f8597ed3cd0",
                "sha1": "992a654b267737174a85cfada20d06cc5c604ad5",
                "sha256": "f029a6ccea94d1bd28cbafbe5d373567d47b878884fd5798c191a5cecb3a42b2"
            },
            "picture": {
                "large": "https://randomuser.me/api/portraits/men/14.jpg",
                "medium": "https://randomuser.me/api/portraits/med/men/14.jpg",
                "thumbnail": "https://randomuser.me/api/portraits/thumb/men/14.jpg"
            }
        }
    ],
    "info": {
        "seed": "e5120471d57b84c6",
        "results": 1,
        "page": 1,
        "version": "1.1"
    }
}

angular controller

$ http.get ('URL-API'). then (function (reponse) {                 $ scope.res = reponse.data;             });

index.html

<div class="input-group input-group-newsletter" ng-controller="userRandom" >
                <form action="/goGame" method="GET">
                    <div ng-repeat="f in res">
                        <div ng-repeat="j in f.login">
                          {{j.username}}
                        </div>
                    </div>
                      <input type="text" class="form-control" name="username" aria-describedby="basic-addon" disabled>
                      <div class="input-group-append">
                        <input type="submit" value="On y vas"/>
                      </div>  
                </form>
              </div>

try the ng-repeat but can not recover the username property

    
asked by Ernesto Emmanuel Yah Lopez 15.03.2018 в 04:19
source

0 answers