Skip to content

Instantly share code, notes, and snippets.

@colintoh
colintoh / sample.json
Last active July 17, 2022 14:24
Sample Data to Pass to Server
{
"result": [
/* Paragraph 1 */
{
"sentences": [
{
"text": "...",
"meta": {}
},
{
var person = {
"name": "colin",
"pets": [{"name": "Bailey"}, {"name": "Molly"}]
};
_.get(person, 'pets[1].name'); // Molly
_.set(person, 'pets[1].name', 'Ginger');
_.get(person, 'pets[1].name') // Ginger
// Using dot notation to access
{{!-- Current Method --}}
{{#if authenticated}}
I'm logged in too!
{{/if}}
{{!-- HTMLBar Method --}}
{{if authenticated "I'm logged"}}
<a href="http://{{name}}.com">{{name}}</a>
{{!-- Current Method --}}
Super mega painful... View solution here: http://stackoverflow.com/questions/9405449/style-attribute-with-emberjs
{{!-- HTMLBar Method --}}
<div style="color:{{divColor}}"> .... </div>
{{!-- Current Method --}}
<div {{bind-attr class=someClass}}> .... </div>
{{!-- HTMLBar Method --}}
<div class={{someClass}}> .... </div>
<div {{bind-attr id=bar}}>.....</div>
{{#each items}}
<li>
<span>{{title}}> </span> <span>{{author}}</span> <span>{{createdAt}}</span>
</li>
{{/each}}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Untitled</title>
</head>
<body>
module.exports = function(grunt){
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.initConfig({
wiredep: {
target: {
src:'index.html',
options: {