Since I’ve been working with the GitHub API lately as well as AngularJS I decided to refactor his code using AngularJS instead of jQuery. I tried to make minimal changes from Jake’s example to make comparison easy.
The results show the power of AngularJS’ data binding and separation of logic and view. There was no need to manipulate the DOM in Javascript or output HTML from Javascript.
It’s a simple, but very nice example, so the refactor wasn’t very difficult. Removing jQuery and using AngularJS, the initial form, getting the user data and displaying it which is two calls to the GitHub API. One to get the user information and another to get a list of that users repositories.
Your new post is loading...