Development on Various Platforms
11.7K views | +0 today
Follow
Development on Various Platforms
Your new post is loading...
Your new post is loading...
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Fun with Backburner.js

ebryn/backburner.js is a queueing library that happens to be the heart and soul of the Ember.js internal workflow. Over in the Ember world, this workflow is referred to as the RunLoop. I have put together a fun little example of Backburner to demystify some of its inner workings and to shed light on how other frameworks put it to use.

But before that, let's take a look at what Backburner has to offer.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Building a tag editor with Ember.js

Building a tag editor with Ember.js | Development on Various Platforms | Scoop.it

I’m often still amazed at just how well Ember deals with complexity.

Ember Components are one of many reasons for this, they very neatly allow us to create decoupled views which can be reused throughout our application. Below tag editor component which consists of 30 lines of clean JavaScript. (view the source on jsbin)


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

ember-autosuggest

ember-autosuggest | Development on Various Platforms | Scoop.it
ember-autosuggest will suggest names from a bound list.

This Plug-In will auto-complete or auto-suggest completed search queries for you as you type.

There is very basic keyboard navigation using the up and down keys to scroll up and down the results and enter adds the selection, while hitting escape hides the autocomplete menu.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Using Ember.js with jQuery UI

You can also define some code to run every time an element is rendered. You can use this hook to wire up any JavaScript library to the element that Ember has created. 

All Ember views have a $ function, which is the normal jQuery function, scoped to the current element. You can also call this.$() to get back a jQuery object wrapping the element itself.

You can use this hook to do anything you want, allowing you to hook in any library you want. You would use this hook a lot like you’d use a jQuery(document).ready hook, but scoped to the view being created.

Ember also provides a willDestroyElement hook, which you can use to tear things down that you set up when the element was inserted. This is relatively rare, and is mostly used when interfacing with another toolkit that requires a teardown, or to tear down custom Ember observers.

 


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Unit Testing Ember Data Models

Ember.js is a JavaScript MVC framework for creating ambitious web applications and is one that, along with the Ember Data library's models, SoftLayer uses for its projects. The "M" in MVC stands for model which is the most important layer in an application, for if the data models are not correctly architected anything built on top of them will inherit their deficiencies. While this post is not going to discuss how to architect your data models in Ember.js it is going to propose a way in which you can Unit Test your model's definitions so that you keep any incongruent changes from being introduced into them.

When we write our Unit Tests we want them to be able to completely test the definition of our data models. This includes properties, their type, any relationships they have with other data models, the generated result of any computed properties and the properties computed properties are observing. 


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Bootstrap for Ember.js

Bootstrap for Ember.js | Development on Various Platforms | Scoop.it

Bootstrap for Ember.js is a collection of UI components based on Twitter Bootstrap v3 for Ember.js

Bootstrap for Ember goes much further than using plain Bootstrap by providing extra functionality by leveraging the power of Ember.

With the power of Ember.js and the beauty of Bootstrap, expect interactive, clean, lightweight, powerful and most importantly very easy to use components. In fact, using the components is usually much easier and shorter than using Bootstrap as is, see showcase!


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Prerender - AngularJS SEO, BackboneJS SEO, or EmberJS SEO

Prerender - AngularJS SEO, BackboneJS SEO, or EmberJS SEO | Development on Various Platforms | Scoop.it

Allow your AngularJS, BackboneJS, or EmberJS apps to be crawled perfectly by search engines.

How it works:
* The Rails or Node middleware inspects the user agent of each request to your app
* If a search engine crawler is detected, the middleware makes a GET request to the Prerender service
* The Prerender service makes a call to your app for the same exact page that the crawler is requesting
* The Prerender service renders the page with all of the javascript using phantomjs
* The HTML of that rendered page is sent back to the middleware in your app
* The middleware then returns that HTML to the crawler


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

A comparison of the two-way binding in AngularJS, EmberJS and KnockoutJS

This is not a talk about which framework is best, or which one you should use in your projects. The focus is on the strengths and weaknesses of the different implementations and finding out what the different frameworks have in common and what they can learn from each other.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

TodoMVC-EAK - EmberJS TodoMVC app port to use Ember App Kit

TodoMVC-EAK - EmberJS TodoMVC app port to use Ember App Kit | Development on Various Platforms | Scoop.it

This is a simple demo implementation of the official Ember's Todo MVC app from the guides section using theEmber App Kit to organize the files and build the project.

A guide explaining the differences between the official guide vs using App Kit should be coming soon.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Ember.js and Google Analytics

Ember.js and Google Analytics | Development on Various Platforms | Scoop.it

Single Page Javascript Applications and specifically Ember.js applications don’t always expose the right information to Google Analytics. Usually you’ll see 100% traffic to / and nothing else.

What I wanted to be able to see what areas of the site people were using in real time. A bit of searching led to various solutions withthis post having the most upto date solution. Working in Ember you quickly become wary of older solutions posted and start filtering search results based on time. Hopefully now that 1.0 is out the correct solutions will start bubbling to the top of Google searches.

To make your Ember.js application more visible to Google Analytics you need to expose the value of your application state. I’m using the hash scheme (eg #/album) so whatever is after the hash in the url shows where a person is in the application.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Django/Ember Authentication is Easy

Django/Ember Authentication is Easy | Development on Various Platforms | Scoop.it

As I’ve previously explained, one of the biggest hurdles to jump when getting started with Ember is authentication. Not anymore! I’ve put together a simple architecture that provides session-based authentication in a relatively small amount of code.

If you Google “Ember authentication” you’ll likely get a handful of SO posts and an even smaller handful of blog posts almost all of which implement some kind of token-based authentication, usually relying on Rails or Node for authentication. This requires you to perform a back-and-forth exchange with the server to authenticate credentials and receive a token. You probably have to store the token in some kind of manually made cookie or local-based storage, and you have to remember to consistently provide the token whenever you access a restricted resource.

Session-based authentication is a lot easier! First, the server-side mechanics for session-based auth are entirely built in to Django. Second, because the majority of the work is done server-side, there is little required of you in Ember. Finally, using session-based auth instead of token-based auth makes SSL a little less of a necessity since you’re not flinging naked tokens around with every request.

REST purists might argue that session-based authentication is technically not “stateless.” The trade-off depends on project requirements and personal preference. For single-page web applications, I can’t think of any practical downsides.

 


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Useful Ember Code Examples

Sharing JavaScript via JSBin, JSFiddle, etc. is great but it can be hard to keep track of them. Here is a list of useful Ember code examples.

* helpers

* components

* d3

* views

* routes

* controllers

* tips


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Why Angular, Ember, or Backbone don't work for us

Why Angular, Ember, or Backbone don't work for us | Development on Various Platforms | Scoop.it

Moot is a special discussion platform with ambitious goals. While the server side is fanatically optimized for performance, the client has its own goals: simple API, small size, and quick release cycle. The code is written from scratch and is split into more than 50 files. A client side framework such as Angular or Ember were out of the question.

Here's why.

* API first
* Small size
* Full control
* Special needs
* Technology lock-in
* Why not Angular?
* Why not Ember.js?
* Why not Backbone.js?
* But jQuery leads to spaghetti, right?
* The results


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Ember.js - Taming computed properties

Ember.js - Taming computed properties | Development on Various Platforms | Scoop.it

In Ember.js there is this feature called computed properties. You can learn more about what computed properties are in the official Ember.js guides. Instead I wanted to talk about how they act depending on what you pass to .property().

To better illustrate how these computed properties act depending on what gets passed to .property() I decided to write yet another todo app example. IMO a task list with ability to add items and mark them as completed is a perfect example. Here’s a complete jsbin for you to play around with and see the end result. Don’t get carried away just yet because I still want to walk you through some of the code and explain what’s what.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Ember Components – Reusable Building Blocks For Your Application

Ember Components – Reusable Building Blocks For Your Application | Development on Various Platforms | Scoop.it

Web components promise to bring reusability and encapsulation to the next version of JavaScript. The bad news is that their power is out of reach until mainstream browsers fully implement the ECMAScript 6 standards that make up web components. Fortunately for Ember.js developers, the power of web components can be leveraged today in the form of Ember components. Ember components share more than a similar name with Web Components, they aim to adhere as closely to the W3C Web Component spec as possible.

In this article, I’ll show you how to use Ember components to build a reusable building block for a scrum card management application. For those of you who have never used Ember before, don’t worry, we’ll also cover some of the basics of Ember.js that you need to know.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Intermediate Ember Controller Concepts

Intermediate Ember Controller Concepts | Development on Various Platforms | Scoop.it

I’ve been finding issues in an Ember application I’m working on where the author (me) didn’t fully grasp Ember controllers. Here are a few controller concepts I’ve learned.

Controller Concepts
* A controller is a decorator for your models. It proxies all the get and set calls to the underlying model unless that property is defined on the controller itself.
* Controllers are fleeting, but models are forever (if you’re taking an Ember Data-like approach). As you route around your application, controllers will be destroyed so don’t count on them surviving very long. An exception to this is the immortal application controller.
* You don’t necessarily need a controller, especially if you’re not holding onto application state. The router events object is a great place to save, create, and delete models.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Ember.js Concepts for Rails Developers

Ember.js Concepts for Rails Developers | Development on Various Platforms | Scoop.it

Moving from a full stack framework like Rails to a front end framework like Ember.js is less of a leap than you might anticipate. You’re probably already using jQuery for some elements of interactivity, but at a certain point, you came up against that wall of maintainability and ended up with a hearty serving of front end spaghetti code. Yum. Here’s where a frontend framework can help, but this can cause a different kind of confusion.

Of course, switching from Rails to a front end framework presents you with a new set of tools, many of which have the same names as the ones you are already familiar with. This really comes to a head with the issue of how responsibilities are delegated, so let’s have a Rails vs Ember.js comparison of the two frameworks to clear this up.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Templating typeahead.js with Ember.js

While working on a recent project of mine, I came across an issue where I had to bind a custom template using typeahead.js. The options in front of me were to either use the example engine of Hogan.js or try to figure out a way to bind the template using Ember.js.

Now looking at the syntax used with typeahead, and reading a bit about Hogan. it was clear that the templating engine was predominantly a mustache based engine. And the idea that sparked from that was a very simple one – Ember usesHandlebars.js which is also based on Mustache. So if one version of mustache can render a template, so can the another.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Componentised Form Validation for Emberjs

Componentised Form Validation for Emberjs | Development on Various Platforms | Scoop.it

Since emberjs has finally been released I thought that I’d update my my approach to form validation to make use of components and a simple controller mixin to keep things DRY.

With this validation solution there are a few thing that I want to achieve:

* Simplified templating. Each input is more than just a simple text box, but comprises label, editbox, validation text and visual feedback. I don’t want to have to type/copy this for every field.
* Validation encapsulation. Each validation form element should be self contained and minimise spaghetti code.
* Async validation support. Some validations happen on the server side (eg, check if email is taken).
* Unobtrusive UI. When a form is initially rendered, don’t immediately start telling the user what they did wrong. Ideally only inform them as they go (after each field loses focus) or when they try to submit.
* Controller integration. The controller should know via a single property if the form state is valid.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Embersmith - Static HTML and JSON generator for Ember.js projects

Embersmith is a Node.js application that takes Markdown files from your project's /contents directory and converts them toHTML & JSON in /public directory.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Ember JS & SEO - How to easily implement SEO friendly URLs in 3 steps

Ember JS & SEO - How to easily implement SEO friendly URLs in 3 steps | Development on Various Platforms | Scoop.it

This post is a follow up to my previous post about SEO and getting your App crawled. A very important topic of SEO are URLs, as they have a big impact on your ranking by the various search engines. Therefore you will want to create custom URLs in your app. In this blog post we will have a look at how to implement custom URLs this with 3 easy steps. At the end i will show you a shortcut that allows you to skip the steps 2 and 3 and do it with 1 step! I will provide JSBins for you to play around with both approaches.

This are the 3 steps towards your custom URLs:

* Modify the mapping in your router and add dynamic segments to customize your URL.

* Implement the serialize method to create an URL representation of your models.

* Implement the model method to convert a URL into a model again. This is needed when a user enters your App via URL, e.g. a user hits refresh or someone shares a link to your page.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

CRUD example app without Ember Data

CRUD example app without Ember Data | Development on Various Platforms | Scoop.it

Ember Data is one of the most ambitious undertakings in recent JavaScript history. It carries the promise of a persistance library that makes it easy to build large browser applications that interact with diverse APIs. Ember Data is evolving quickly as the Ember Core Team experiments and iterates the library to create a generalized solution that will work for many use cases. These changes introduce code with kinks that haven't been ironed out yet. When using Ember Data developers often find themselves digging into the library in order to find where the problem originates.

Digging into Ember Data source code is easier for experienced Ember developers who are familiar with Ember Data's history and Ember community. For a beginner who is building a small browser app this can be extremely frustrating because it's difficult to find the source of the problem. Innevitably beginners waste days trying to figure out how to get their apps to make simple requests to their non conventional APIs.

This article was written as an alternative to that experience. The goal of this article is to help you undestand Ember architecture and allow you to build simple apps without relying on Ember Data.

There will come a day when Ember Data is a rock solid library that is easier to use than writing your own AJAX requests. Until that day, I recommend learning Ember architecture and rolling out your own persistance layer. This will give you the added bonus of understanding how Ember Data ties into Ember and what problems it's trying to solve for you.

This articles walks you through creating a CRUD app without Ember Data to give you a better understanding of Ember architecture.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Events & Actions in Ember.js

Events & Actions in Ember.js | Development on Various Platforms | Scoop.it
Understanding events & actions (and the differences between them) will help you build cleaner, more maintainable Ember.js apps.

Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Setting up an Ember App with a Rails Backend

Setting up an Ember App with a Rails Backend | Development on Various Platforms | Scoop.it

Today I’m going to show you how to setup an Ember app with a Rails backend. The process is relatively straightforward, but there are some gotchas that I’d like to help you avoid.

The app will use Haml, CoffeeScript, Emblem, and Ember Data. In this tutorial I’ll be starting a sample app called Launch Bay. Launch Bay would essentially be an ultra-lightweight version of Pivotal Tracker. In this first post I’m just going to get my app setup to receive data.


Via Jan Hesse
more...
No comment yet.