尝试将url传递给fetchFromURL函数,但在登录时未定义URL。不知道为什么会发生这种情况!!
class Device extends Backbone.Model
class Devices extends Backbone.Collection
model: Device
localStorage: new Backbone.LocalStorage 'devices'
url: "http://192.168.2.17:8030/profile/RestProfile.svc/GetDeviceList/"
fetchFromURL: =>
collection = @
console.log @url
getView = =>
devices = new Devices
devices.fetch()
devices.fetchFromURL()