Beginning AngularJS
CHApTer 5 ■ DIreCTIveS // a function, placed into the scope, which // can toggle the value of the isHidden variable $scope.showH ...
CHApTer 5 ■ DIreCTIveS For a relatively small amount of code, we get a fairly useful piece of functionality. This shows how dire ...
CHApTer 5 ■ DIreCTIveS ngInclude This handy directive lets you include the contents of another file within your document. Take, ...
CHApTer 5 ■ DIreCTIveS The ng-hide class is very simple and nothing more than a single CSS rule, as follows. .ng-hide{ display: ...
CHApTer 5 ■ DIreCTIveS Event-Handling Directives We have seen ngClick already, though Angular JS comes with similar directives f ...
CHApTer 5 ■ DIreCTIveS I wish I could say that all of the answers are to be found in the API documentation, but many of the prob ...
CHApTer 5 ■ DIreCTIveS As you can see, it’s quite easy to use this directive. It looks and behaves in the same way as product-de ...
CHApTer 5 ■ DIreCTIveS When should you use an element and when should you use an attribute? You can use either, and the end resu ...
CHApTer 5 ■ DIreCTIveS We need a link function that achieves all but one of these requirements. The first requirement is already ...
CHApTer 5 ■ DIreCTIveS Within the forEach loop, we do the append operation by creating a div element as a string value that is c ...
CHApTer 5 ■ DIreCTIveS return { restrict: 'AE', template: "" "{{isHidden? 'Show Available Colors' : 'Hide Available Colors'}}" ...
Chapter 6 Working with Forms Since their introduction in the mid-90s, HTML forms have taken a largely static World Wide Web and ...
CHApTer 6 ■ WorkIng WITH ForMS The form in the preceding code snippet is configured to use the post method and to submit its dat ...
CHApTer 6 ■ WorkIng WITH ForMS It is the value attribute that determines the text that appears on the button. The name attribute ...
CHApTer 6 ■ WorkIng WITH ForMS radio The radio button control is perhaps the trickiest input type. Named after the old-fashioned ...
CHApTer 6 ■ WorkIng WITH ForMS The select Element The select element is a container for a series of option elements. These optio ...
CHApTer 6 ■ WorkIng WITH ForMS Listing 6-3. Using the First option Element As a Prompt Choose your favorite food I love Eggs! F ...
CHApTer 6 ■ WorkIng WITH ForMS ■ Note AngularJS model binding happens inside a process called the digest loop. In simple terms, ...
CHApTer 6 ■ WorkIng WITH ForMS First name is: {{person.firstName}} Street name is: {{person.address.street}} Listing 6-4 an ...
CHApTer 6 ■ WorkIng WITH ForMS Here is the associated controller code: Listing 6-7. Implict Model Binding—Controller Code angula ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf