Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
hifi: Ember.inject.service(),
poll: Ember.inject.service(),
ajax: Ember.inject.service(),
updateData() {
this.get('ajax').request('https://api.prod.nypr.digital/whats-on/v1/whats-on?stream=wqxr').then((result) => {
@matthias-k
matthias-k / mirage.config.js
Last active August 11, 2017 12:12
Mirage Dev Boilerplate
export default function() {
//window.server = this;
this.get('users');
};
@matthias-k
matthias-k / controllers.application.js
Last active October 2, 2016 17:49 — forked from initram/controllers.application.js
Access parent component in source function
import Ember from 'ember';
import myTemplate from '../templates/suggestion-template'
export default Ember.Controller.extend({
suggestionTemplate: myTemplate,
getDisplayString : function(suggestion) {
if(typeof suggestion === "string")
return suggestion;
return suggestion.text;