Last active
June 14, 2017 12:48
-
-
Save orf/625abf7d2eff52a579bf2d82c1eceadc to your computer and use it in GitHub Desktop.
New Twiddle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import fetch from 'fetch'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
noDnsFailed: null, | |
noDnsFailedRealFetch: null, | |
SSLFailed: null, | |
SSLFailedRealFetch: null, | |
init(){ | |
this._super(...arguments); | |
fetch('http://asdsadsadasdasdasdasdsadasdasdasdasd.xyas').then( | |
()=>{this.set('noDnsFailed', false)}, | |
()=>{this.set('noDnsFailed', true)}); | |
fetch('https://untrusted-root.badssl.com/').then( | |
()=>{this.set('SSLFailed', false)}, | |
()=>{this.set('SSLFailed', true)}); | |
window.fetch('http://asdsadsadasdasdasdasdsadasdasdasdasd.xyas').then( | |
()=>{Ember.run.next(()=>this.set('noDnsFailedRealFetch', false))}, | |
()=>{Ember.run.next(()=>this.set('noDnsFailedRealFetch', true))}); | |
window.fetch('https://untrusted-root.badssl.com/').then( | |
()=>{Ember.run.next(()=>this.set('SSLFailedRealFetch', false))}, | |
()=>{Ember.run.next(()=>this.set('SSLFailedRealFetch', true))}); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-fetch": "2.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment