⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="wrapper style1 container special"> | |
<div class="row"> | |
<h2 class="space-above">Latest Posts</h2> | |
</div> | |
<div class="row"> | |
{% for article in all_articles %} | |
{% if loop.index < 4 %} | |
<div class="4u"> | |
<section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
//Get the contents | |
var source = document.querySelector("#results-template").innerHTML; | |
//Compile them into a template | |
template = Handlebars.compile(source); | |
// add the formatName helper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global Todos Ember */ | |
'use strict'; | |
Todos.EditTodoView = Ember.TextField.extend({ | |
classNames: ['edit'], | |
valueBinding: 'todo.title', | |
change: function () { | |
var value = this.get('value'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global Todos DS Ember */ | |
'use strict'; | |
Todos.Todo = DS.Model.extend({ | |
title: DS.attr('string'), | |
isCompleted: DS.attr('boolean'), | |
todoDidChange: function () { | |
Ember.run.once(this, function () { | |
this.get('store').commit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global Todos Ember */ | |
'use strict'; | |
Todos.Router.map(function () { | |
this.resource('todos', { path: '/' }, function () { | |
this.route('active'); | |
this.route('completed'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global Ember */ | |
window.Todos = Ember.Application.create(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/x-handlebars" data-template-name="todos"> | |
<section id="todoapp"> | |
<header id="header"> | |
<h1>todos</h1> | |
{{view Ember.TextField id="new-todo" placeholder="What needs to be done?" | |
valueBinding="newTitle" action="createTodo"}} | |
</header> | |
{{#if length}} | |
<section id="main"> | |
<ul id="todo-list"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ember Starter Kit</title> | |
<link rel="stylesheet" href="css/normalize.css"> | |
<link rel="stylesheet" href="css/style.css"> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an Ember App instance | |
App = Ember.Application.create(); | |
App.Router.map(function() { | |
// put your routes here | |
}); | |
// return an elemtary model as a list | |
App.IndexRoute = Ember.Route.extend({ | |
model: function() { |