5. JavaScript
● programming language,
● most commonly used as part of web browsers
● allows client-side scripts to interact with the user, control
the browser, communicate asynchronously, and alter
the document content that is displayed
6. jQuery vs vanilla JavaScript
// jQuery
$.post('//example.com', { username: username }, function (data) {
// code
});
// Vanilla
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function (data) {
// code
}
httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
httpRequest.open('POST', url);
httpRequest.send('username=' + encodeURIComponent(username));
7. About Angular.js
● JavaScript framework
● for Single Page Applications
● developed by Google
8. Cool things about Angular
● directives
● two-way data bindings
● Model-View-Controller
● modules
● history
● jQLite
9. Directive
“At a high level, directives are markers on a DOM element
(such as an attribute, element name, comment or CSS
class) that tell AngularJS's HTML compiler ($compile) to
attach a specified behavior to that DOM element or even
transform the DOM element and its children.”
Cool way to extend HTML easily by simply
adding attributes, elements or comments.
20. Part 1
1. Open tasks/part1/index.html
2. Add at least one superhero,
then display all of the
3. Enable filtering superheros
based on 'search' input
25. Part2
1. Open tasks/part2/superheros_controller.js
2. Open tasks/part2/index.html
3. Add missing code to display list of superheros
4. Add more superheros to SuperherosController
5. Display information about superpowers
6. Use form to add more superheros
31. Part3
1. Open tasks/part3/index.html
2. Add 'ui.bootstrap' to superheroApp
3. Make sure we only display image when hero.image is present
4. Run 'showBigImage' on click