Beginning AngularJS
Chapter 7 ■ ServiCeS and Server CommuniCation return dateTimeSvc; }).controller("MyController", function ($scope, dateTimeServic ...
Chapter 7 ■ ServiCeS and Server CommuniCation It’s a fairly bare-bones implementation of a service, but it does cover the basics ...
Chapter 7 ■ ServiCeS and Server CommuniCation The Promises API is very sophisticated, and it aims to improve on the way this kin ...
Chapter 7 ■ ServiCeS and Server CommuniCation Let’s take the $http service and use it within our own service, a service we will ...
Chapter 7 ■ ServiCeS and Server CommuniCation Listing 7-7. Making Use of Our Custom Service <!DOCTYPE html> Registratio ...
Chapter 7 ■ ServiCeS and Server CommuniCation if (!$scope.registrationForm.email.$valid) { $scope.emailInvalid = true; } if (!$s ...
Chapter 7 ■ ServiCeS and Server CommuniCation input[name='email'].ng-dirty.ng-valid-email { color: green; } form span, .error { ...
Chapter 7 ■ ServiCeS and Server CommuniCation There is a fair bit going on here, much of which was covered in the previous ...
Chapter 7 ■ ServiCeS and Server CommuniCation Both of these div elements make use of the ngShow directive. Only one or the other ...
Chapter 7 ■ ServiCeS and Server CommuniCation We can’t place this code in the success method, because, if an error occurs, our f ...
Chapter 7 ■ ServiCeS and Server CommuniCation This example assumes that we received a JSON response from the server and that thi ...
Chapter 8 Organizing Views AngularJS excels when it comes to the creation of single-page applications, or S PAs, as they are com ...
Chapter 8 ■ Organizing Views A page listing various Angular modules appears. You want to download the angular-route.js file (or ...
Chapter 8 ■ Organizing Views Using URL Routes You’ll learn about routes through a small web site that we will create as we proce ...
Chapter 8 ■ Organizing Views Listing 8-3. index.html, the Entry Page for Our Demo Web Site <!DOCTYPE html> var app ...
Chapter 8 ■ Organizing Views $scope.message = 'There seems to be a problem finding the page you wanted'; $scope.attemptedPath = ...
Chapter 8 ■ Organizing Views We have declared ngView as an attribute on a div element; consequently, this div element is where o ...
Chapter 8 ■ Organizing Views Listing 8-6. The Contact Page, contact.html Contact Page {{ message }} Listing 8-7. The Route N ...
Chapter 8 ■ Organizing Views Table 8-1 shows a few of the $location services methods acting on various URLs, though right now, w ...
Chapter 8 ■ Organizing Views .otherwise({ // when all else fails templateUrl: '/pages/routeNotFound.html', controller: 'notFound ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf