Skip to content

Instantly share code, notes, and snippets.

Tom Wayson tomwayson

View GitHub Profile
@tomwayson
tomwayson / components.my-component.js
Created Aug 8, 2018
classNameBindings works w/ CPs
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: ['redText'],
redText: Ember.computed.alias('isRed')
});
@tomwayson
tomwayson / angular2-esri-loader-angular-cli-instructions.md
Last active Dec 21, 2017 — forked from jwasilgeo/angular2-esri-loader instructions.md
How to use angular2-esri-loader in an angular-cli application
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
@tomwayson
tomwayson / index.html
Last active Aug 17, 2017
Custom ArcGISDynamicMapServiceLayer
View index.html
<!DOCTYPE html>
<html>
<!--
Example of how to extend the ArcGISDynamicMapService layer to send custom parameters to exportMap.
Adapted from the Dynamic Map Service Example:
https://developers.arcgis.com/javascript/jssamples/map_dynamic.html
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
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 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|}}
You can’t perform that action at this time.