Skip to content

Instantly share code, notes, and snippets.

@mikegrassotti
Last active July 25, 2018 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikegrassotti/05af5acccddbd6bcba05dbe043b2bd68 to your computer and use it in GitHub Desktop.
Save mikegrassotti/05af5acccddbd6bcba05dbe043b2bd68 to your computer and use it in GitHub Desktop.
mpg-testing-2
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement() {
console.log('inserted places component');
var placesAutocomplete = window.places({
container: document.querySelector('#address-input'),
});
}
});
<input type="search" id="address-input" placeholder="Where are we going?" />
@import "bulma";
h1 {
color: pink;
}
<section class="section">
<div class="container">
<h1 class="title">
Hello {{appName}}
</h1>
<p class="subtitle">
My first website with <strong>Bulma</strong>!
</p>
{{bulma-notification notification="First column" isPrimary=true}}
{{autocomplete-input class="input is-large" name=name results=results updateTerm="updateTerm" selectResult="selectResult"}}
<hr/>
<h3>Algolia Places</h3>
{{places-autocomplete}}
{{outlet}}
</div>
</section>
import { run } from '@ember/runloop';
export default function destroyApp(application) {
run(application, 'destroy');
}
import Resolver from '../../resolver';
import config from '../../config/environment';
const resolver = Resolver.create();
resolver.namespace = {
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix
};
export default resolver;
import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
const { run } = Ember;
const assign = Ember.assign || Ember.merge;
export default function startApp(attrs) {
let application;
let attributes = assign({rootElement: "#test-root"}, config.APP);
attributes = assign(attributes, attrs); // use defaults, but you can override;
run(() => {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
}
import resolver from './helpers/resolver';
import {
setResolver
} from 'ember-qunit';
import { start } from 'ember-cli-qunit';
setResolver(resolver);
start();
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": true,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2",
"bulma": "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.css",
"autocomplete": "https://cdn.jsdelivr.net/npm/places.js"
},
"addons": {
"ember-data": "3.2.0",
"ember-bulma": "0.4.1",
"ember-cli-autocomplete-input": "1.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment