Instantly share code, notes, and snippets.

View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: ['redText'],
redText: Ember.computed.alias('isRed')
});
View basis-interpolation-line-chart.json
{
"$schema": "https://vega.github.io/schema/vega/v3.0.json",
"width": 500,
"height": 200,
"padding": 5,
"data": [
{
"name": "table",
"values": [
View angular2-esri-loader-angular-cli-instructions.md

Adding angular2-esri-loader to the app and creating a map

NOTE: These instructions apply to trying to use the ArcGIS API for JavaScript in an Angular 2 application created w/ angular-cli. If you're working with more recent versions of Angular, you should use https://github.com/Esri/esri-loader instead.

  1. Create a new Angular app by using angular-cli to generate a new project

  2. Install angular2-esri-loader

npm install angular2-esri-loader esri-loader --save
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
checked: Ember.computed('model.id', 'itemsToAdd.[]', function () {
const itemsToAdd = this.get('itemsToAdd');
return !!itemsToAdd.findBy('id', this.get('model.id'));
}),
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init () {
// create a script object whose source points to the API
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://js.arcgis.com/4.2/';
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['appid'],
appName: 'Ember Twiddle',
init () {
console.log('appid', this.get('appid'));
}
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View hack.hbs
{{page-layout }}
{{#each layoutRow as |row|}}
{{layout-row style=row.style}}
{{cards-layout}}
{{/layout-row}}
{{/each}}
{{/page-layout}}
{{page-layout-editor }}
{{#each layoutRow as |row|}}
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console