Cordova supplies a deviceready event that fires when Cordova is fully loaded and ready for action. In this video, Tom Duffy creates Park It's deviceready event handler.
- [Instructor] In the init function,…you call the document object's addEventListener method…and promise to create an onDeviceReady function.…It's time to implement that function.…Add a function reference that points to onDeviceReady,…no arguments, function body.…Since we are asking Cordova to tell us…which platform the app is running on,…we must dynamically load the correct stylesheet…in the onDeviceReady function.…This ensures that Cordova is up and running…and can actually give us the platformId.…
Add a node variable to the onDeviceReady function…to create the link element needed to load the stylesheet.…I'm going to call that variable node…and I'm going to set it to the results…of document.createElement…and I'm going to create a link element,…and this makes perfect sense since we load stylesheets…using a link element in HTML.…I'll also set a few attributes…that are common no matter what stylesheet is loaded.…
The first one will be the rel attribute…and we can set that to be stylesheet,…and the next one, is the type attribute,…
- Understanding Cordova's value proposition
- Installing the Cordova CLI
- Accessing mobile device capabilities, including geolocation and data storage
- Using Android Studio and Xcode in conjunction with Cordova
- Creating platform-specific stylings to match native interfaces
Skill Level Beginner
Ionic 2 and AngularFire2: Building Mobile Appswith Steven Emmerich57m 27s Intermediate
Ionic 3.0 for Mobile App Developerswith Sani Yusuf5h 43m Intermediate
1. Cordova's Value Proposition
What is Cordova?2m 21s
2. Creating the Web App
3. Installing and Using Cordova
4. Using Cordova with Platform Tools
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.