Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Node.js for Mobile Application Development

You're reading from   Learning Node.js for Mobile Application Development Make use of Node.js to learn the development of a simple yet scalable cross-platform mobile application

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781785280498
Length 248 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (16) Chapters Close

Preface 1. Setting Up Your Workspace FREE CHAPTER 2. Configuring Persistence with MongoDB 3. Creating an API 4. Securing Your Backend 5. Real-Time Data and WebSockets 6. Introducing Ionic 7. Building User Interfaces 8. Making Our App Interactive 9. Accessing Native Phone Features 10. Working with APIs 11. Working with Security 12. Working with Real-Time Data 13. Building an Advanced Chat App 14. Creating an E-Commerce Application Using the Ionic Framework Index

Putting it all together


We now have a full-fledged directive, and it's time to integrate it into our app. First, make sure that the new directive is properly loaded. The first line of the app.js file should look like this:

angular.module('supernav', ['ionic', 'supernav.controllers', 'supernav.directives'])

Likewise, the index.html file should contain the following import:

<script src="js/directives.js"></script>

Next, make sure that the ion-content section in index.html now looks like this:

<ion-content scroll="false">
  <map on-create="mapCreated(map)"></map>
</ion-content>

Next, since we moved the rendering logic for the map into the directive, remove it from the controller.js file, which should now look like this:

angular.module('supernav.controllers', [])
.controller('MapCtrl', function ($scope) {
  $scope.mapCreated = function (map) {
    $scope.map = map;
  };
});

Finally, we need to make some slight modifications to style.css in order to make sure that...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image