-
Other
- http://emberjs.jsbin.com/rwjblue/82/edit - Opening a window and communicate with it.
- http://emberjs.jsbin.com/rwjblue/55/edit - Using liquid-fire animations in globals mode.
- http://emberjs.jsbin.com/rwjblue/151/edit?js,output - Modify computed dependent keys after initialization.
-
POJO's
- http://emberjs.jsbin.com/rwjblue/139/edit?html,js - Defining computed properties on a POJO.
-
Routing
-
http://emberjs.jsbin.com/rolo/3 - Shows route hook ordering.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ember Starter Kit</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v2.0.0.js"></script> | |
<script src="http://builds.emberjs.com/tags/v1.9.0/ember.js"></script> | |
<style id="jsbin-css"> |
“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important
or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”
You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?
This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.
Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
inputtedVal:'Ember Twiddle' | |
}); |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: { | |
level1: { | |
string: "<b style='color: red;'>Emberjs</b>" | |
} | |
} | |
}); |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
features: Ember.inject.service(), | |
actions: { | |
enableDepartments() { | |
this.get('features').enable('departments'); | |
}, |
nav { | |
margin-top: 100px; | |
padding: 10px; | |
background: #ddd; | |
color: #666 | |
} | |
.form-group { | |
margin: 20px; | |
} |
import Ember from 'ember'; | |
import config from '../config/environment'; | |
const { Service, computed, get } = Ember; | |
const defaultTheme = config.themes.defaultTheme; | |
export default Service.extend({ | |
themeTemplateString: computed(function() { | |
let themeTemplate = document.getElementById('custom-theme-template'); | |
let templateStyles = themeTemplate.content.querySelectorAll('style')[0]; |