Skip to content

Instantly share code, notes, and snippets.

@nathanclark
Created January 18, 2018 06:55
Show Gist options
  • Save nathanclark/80b1d0bc393b2d644ab0e3e184a5de43 to your computer and use it in GitHub Desktop.
Save nathanclark/80b1d0bc393b2d644ab0e3e184a5de43 to your computer and use it in GitHub Desktop.
aritists video details
import Route from '@ember/routing/route';
export default Route.extend({
model: function(params,transition) {
let artist_id = transition.params["artists.show"].id;
var videos = this.store.query('artist', {"artist_id":artist_id , "videos": params.guid })
.then(function (a) {
// How to I pass the guid into the function?
console.log(params.guid) // params.guid == undefined because it is out f scope.
//
var video = a.get("firstObject").get('videos')
return video;
});
return videos;
}
});
import Route from '@ember/routing/route';
export default Route.extend({
model: function(params,transition) {
let artist_id = transition.params["artists.show"].id;
var video = this.store.query('artist', {"artist_id":artist_id , "video": params.guid })
.then(function (asset) {
// How to I pass the guid into the function?
console.log(params.guid) // params.guid == undefined because it is out f scope.
//
var video = asset.get("firstObject").get('videos')
return video;
});
return video;
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{
"version": "0.13.0",
"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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment