Skip to main content

7 Ember Features and Where to Find Them

Transcripts

So far in this series, we've focused on the basics, how to get a simple ember app running, and connected with rails, but there's a lot more features, a lot more power in ember that I don't have time to go over in detail, but I can give you a quick overview, and then a pointer on where you can find more information. Here's some of the thing that the ember guides think that you should know to get started. For example there is the object model which is very similar to ruby's object model, and much easier to use than the default JavaScript version. There is routing. What a route does, is you can click on a link and notice the URL is changing, and the goal of the router is to make sure that at any time, if you reload the page, then you'll be in the same state that you were before, so it's just as if it was a server rendered page, and this can be difficult with just plain JavaScript if you try to jam some JavaScript into your rails app, but with ember, then no matter what you do, unless of course you're filling out a form, then it will store it in the URL, and then when you reload, your user will be at the same state. This is true not just of the main routes, but there's also something called query params, so here notice what the route is going to do when I click on the comment section. So it has this query params, and when I reload, it keeps those, and it opens up the comment section automatically, and then when you go to the next lesson, you can choose weather to keep those query params or get rid of them, so this is a very powerful feature that is not in the other JavaScript frameworks, and would be very hard to do if you were just doing your own JavaScript. The next feature, components, is about having functionality that is both repeatable and encapsulated, so each of these is a component, and weather it's open or closed, it's stored within the component. Another component that we have is the comments, and in this particular instance, we have components nest within components. So here is a discussion section component, and it's looping through all the comments that are attached to that post, to that video, and it's using the comment display component there, and then, each comment can have child comments, and you'll see here at the end of the comment display it will call another comment display for each of the replies. Component isn't just a template. Component is a pair of a template and a JavaScript file, it's actually very similar to a template in a controller, with just a couple of extra added features, and of course the fact that a controller is within a specific route where there's a component is done anywhere you want as many times as you want within another handlebars template. There's a lot more with components, and I wish I could tell you all about closure actions and all the data flow stuff and lots of more stuff, but we need to move on to our other features, one of which is handlebars helpers, so we've seen some basics before with if helper and each helper, but we have helpers such as add and concat, and actually add is not directly from ember, it's a custom one, and you can do custom helpers either yourself, so here I have the getLessonIcon helper, this is purely functional, but add specifically comes from an add-on, add comes from the ember math helpers add-on, and so what I did to get it was I typed ember install ember-math-helpers into the command line, and it gave me all of these helpers. Pretty useful, right? Well there is plenty more, so if you go to emberobserver.com, you'll see the hundreds of ember addons. They're grouped in categories, there's 65 different addons that you can do for styling your app, 91 for testing, lot's of different components that you can drop in. If you have having the gem in bundler ecosystem, then you'll love working in ember, but beyond the addon ecosystem, there's a couple more core things that I want to show you. There's services, which are basically global singletons. They're really good for having session services for example, and these services can also be included in an addon. So Tory is an addon that helps you connect with places like GitHub with OAuth2, and metrics are something that helps you connect with various tracking services, like Google Analytics, and then of course there's ember data, which we saw earlier, but which can expand to meet your needs. So here we have it connected with various model classes, and right out of the gate, it has lots of great features, as well as some more fiddly things to help you tune your performance when you're pulling down a lot of data. So that is a lot of stuff. Where can you go to learn more about ember?

One option is Ember School, which I've created to take you from a beginner to an intermediate employable ember developer. There's almost 200 videos recorded just like this one, as well as exercises challenges and projects. But if you're broke, or you simply don't want to invest in your ember learning, then there's free resources such as the ember guides, which are kept pretty up to date. There's also the e-book Ember101, and then if you want to keep up with stuff that is cutting edge, then Ember Weekly is a great newsletter subscribe to. You'll see lot's of new articles, lot's of new videos, and you'll get a feel for what the resources of the ember community are. One resource you'll see in there a lot is ember screencasts. Which is sort of like GoRails, but it's for Ember. I've created two videos every week for the last couple years. I do mean it for people who already know some ember, so if you're just getting started, then Ember School is definitely the better one of my resources to go to. So I hope that you've enjoyed learning the basics of ember. If you're exited to learn more, then the ember community is excited to have you. But whatever you decide, I hope you continue to make awesome things on the web. See you around

Transcript written by Miguel

Discussion


Gravatar

Thank you for the resources .


Gravatar
Shawn Nigel Rebello

Thanks for all these videos


Gravatar

Hi. I usually deploy alpha level rails apps to Heroku. Considering I am using an ember frontend with rails now. How will I go about deploying?


Login or create an account to join the conversation.