Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Model = Backbone.Model.extend({
- url: function(){
- return '/api/rest/album/id/'+ this.id
- }
- });
- var AlbumView = Backbone.View.extend({
- el: '.content-page',
- template: 'album',
- render: function() {
- this.model.fetch({
- success: function(data) {
- }
- });
- }
- });
- var Router = Backbone.Router.extend({
- routes: {
- 'album/:id': 'albumPage'
- },
- albumPage: function(id) {
- var dados_alb = new Model({id: id});
- dados_alb.fetch({
- success: function(data) {
- console.log(data.get('alb_nome'));
- }
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement