16.07.2017 Views

AngularJS Essentials

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

The parking lot is empty<br />

<br />

<br />

<br />

Pick a color<br />

<br />

<br />

Park<br />

<br />

<br />

<br />

app.js<br />

var parking = angular.module("parking", []);<br />

controllers.js<br />

parking.controller("parkingCtrl", function ($scope) {<br />

$scope.appTitle = "[Packt] Parking";<br />

$scope.cars = [];<br />

$scope.colors = ["White", "Black", "Blue", "Red", "Silver"];<br />

$scope.park = function (car) {<br />

[ 33 ]<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!