Day 9: Intro to Angular
Friday, June 10, 2016
Student Presentations
Group projects demonstrating the use of jQuery, DOM manipulation, and using Ajax to consume REST APIs.
Topics: Introduction to Angular
Concepts
Directives
In the view (HTML), directives are specified with kebab-case (or “dasherized”)—that is, with words separated by hyphens. Within JavaScript, they are specified with camelCase.
- ngApp: Auto-bootstraps an Angular application and (optionally) specifies the root Module.
- ngController: Attaches a Controller to the view/DOM.
- ngModel: Binds a form field to a property on the scope.
- ngRepeat: Repeat an element for each item in a collection.
- ngSubmit: Specifies custom behavior (often an invocation of a function property on the scope) when a form is submitted.
- Automatically prevents default, unless the
action
attribute is set on the form.
- ngClick: Specifies custom behavior when an element is clicked.
- ngShow: Show an element only when the provided expression is truthy.
- ngHide: The inverse of
ngShow
. Only show the element if the provided expression is falsey.
- ngBind: Tells Angular to replace the text of the element with the value of an expression. You typically use
{{ expression }}
instead, but ngBind
prevents the template from being displayed briefly when the page loads. But for that you can also use…
- ngCloak: Prevent the template from displaying before the view is fully rendered.
Projects
Acrobats: source | live