Skip to content

Instantly share code, notes, and snippets.

@tubia
Last active August 29, 2015 14:22
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 tubia/b65a8cd1105483725ae9 to your computer and use it in GitHub Desktop.
Save tubia/b65a8cd1105483725ae9 to your computer and use it in GitHub Desktop.
Ember-cli not rendering API
/* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'ember-test',
environment: environment,
baseURL: '/ember-test/dist/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
}
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
},
sassOptions: {
includePaths: ['bower_components/materialize/sass']
}
};
if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
ENV.contentSecurityPolicy = {
'connect-src': "'self' https://api.github.com/*",
'style-src': "'self' http://localhost:4200/*",
};
}
if (environment === 'test') {
// Testem prefers this...
ENV.baseURL = '/';
ENV.locationType = 'none';
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
}
if (environment === 'production') {
ENV.contentSecurityPolicy = {
'connect-src': "'self' https://api.github.com/*"
};
}
return ENV;
};
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
this.route('user', { path: '/users/:username'});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model: function(params){
return Ember.$.getJSON('https://api.github.com/users/' + params.username);
}
});
<h1>User details</h1>
<div class="row">
<div class="col s12 m6">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">{{login}} {{log login}}</span>
<img src={{avatar_url}} alt="">
<p>{{bio}}</p>
<a class="waves-effect waves-light btn">Number of repos {{public_repos}}</a>
</div>
<div class="card-action">
<a href="#">Hireable: {{hireable}}</a>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment