Sunday, 15 March 2015

javascript - empty params variable in ember -


So I have set up a router and some routes, and it works for the most part. When I load # / contact / 123 (or whatever), contactIndexRUTE returns empty params objects, I'm sure this is relatively simple, but I do not know why can someone show me the right direction? Thank you.

  call monitor.rotor.map (function () {this.resource ('contact', function () (this.resource ('contact', {path: '/: contact_id'} CallMonitor.ContactsRoute = Ember.Route.extend ({Model: Function () {this.store.find ('Contact');}, setupController: Function (Controller, Contact ) {Var socket = CallMonitor.Socket; controller.set ('socket', socket); controller.set ('contact', contact);}, renderemetlet: function () {this._super (this, argument); this. Render ('contacts', {in: 'application', outlet: 'contact', controller: 'contact'});}}); CallMonitor.ContactIndexRoute = Ember.Route.extend ({Model: Functions (Params) {return .store.find ('contact', params.contact_id);}, renderTemplate: function () {this._super (this, logic) setup (controller, contact), (controller, contact) {controller.print ('contact' , Contact Controller:;}}); CallMonitor.ContactsController = Ember.ArrayController.extend ('Contact', {Outlet: 'Points', In: 'Contact', Controller: 'Contact Index'})} {Actions: {getPoints: function} {this.transitionToRoute ('contact', data.id); Console.log ('data' + data);}}, SocketDidChange: function () {var socket = this.get ('socket'), itself = it; If (socket) {socket.on ('call', function) {if (data.contactPointId) {} ​​else if (Data.contactId) {var contactToUpdate = self.contact.filter (function (item) { Return item.id == data.contactId;}), if (contactToUpdate.length) {contactToUpdate [0] .reload ();} Else {// Reload all contacts. ContactPublish = self.contact.store .fi nd ('contact'); ContactPromise.then (function (data) {self.set ('contact', data);}, undefined);}}}); }} .observes ('socket')}); The paragraphs are passed only on the path which defines the slug. Which means that if you define a slug on the resource, then it is present only on the source, and it does not have its root if it is defined on any route under any resource, then it remains on that path.  
  callonitor Contractual = Amber way. Extension (Parameters) {return.store.find ('contact', params.contact_id);}, renderTemplate: function () {this._super (this, argument); this.render ('contact', {Outlet: 'points', in: 'contacts', controller: 'ContactsIndex'})}, setupController: function (controller, contact) {controller.set ('contact', contact);}});  

No comments:

Post a Comment