尝试将 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()