Join Justin Yost for an in-depth discussion in this video Template conditionals, part of Ember.js Essential Training.
- [Instructor] Template conditionals are a way…for us to ask a question in a template…and make a decision to decide on what to display,…depending upon the answer.…We use helper in Ember to provide us…with these conditionals.…We have an if helper, an else helper,…and an NLS helper.…Let's build this to update our About page…to only list public bookmarks.…To begin, let's look at our route for the About page…at app,…routes,…about.js.…
In our About page here, it's still using the code…that grabs our collection of static bookmarks,…so let's update this to access the store…and grab our bookmarks, following the pattern…that we've already seen.…We'll replace online 24, the return bookmarks,…with return this.get,…the string store,…to get our store, and then .FindAll,…and then pass in the name of the model,…in this case, bookmark.…
We can also now remove our bookmarks variable…from Line 3 through 20.…Now, let's update the about template…at app, templates,…about.hbs.…Add after our each loop on Line 3,…if bookmark.public,…so this will look like…
- Why choose Ember?
- Installing Ember.js and Ember Inspector
- Defining the model
- Creating nested and dynamic routes
- Loading templates with routes
- Rendering different templates
- Displaying collections
- Working with Ember components
- Building forms
- Creating, editing, and deleting records
- Configuring Ember.js applications
- Testing your Ember application
- Installing add-ins
- Upgrading an Ember application
Skill Level Intermediate
1. Ember.js Basics
2. Getting Started with Ember.js
3. Our First Ember.js Application
4. Ember.js Routes
5. Ember.js Models
6. Ember.js Templates
7. Ember.js Components
9. Application Configuration
Build an app for production3m 29s
11. The Ember.js Community
- 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.