javascript - How to make an Angular.js app in Plunker -
i'm trying make example angular4 in plunker. however, don't know how make works. see how should done in correct way.
myplunker example should this: firstnames url , show them. when user clicks on of these firstnames see entry's firstname, lastname , email...
var app = angular.module('app', []); app.controller('mainctrl', function($scope, myservice){ var getfirstname = function(){ myservice.getfirstname(function(data){ $scope.user = data; }); }; getfirstname(); }); app.service('myservice', function($http){ return{ getfirstname: function(callback){ $http.get('http://hjgz2l4w8r2zvaym4-mock.stoplight-p roxy.io/api/users').success(calback); } } });
Comments
Post a Comment