IronRouter extending data option on route controller

前端 未结 4 1701
清酒与你
清酒与你 2021-02-20 13:16

Is there a way to extend the data option when using IronRouter and the RouteController, It seems like it gets overridden when I inherit from a super co

4条回答
  •  孤城傲影
    2021-02-20 13:27

    To add to the selected answer, note that if you're using Coffeescript the following will yield the same result:

    class @ChildController extends ParentController
      data: -> super()
      # or if you want to add to it:
      data: ->
        _.extend super(), { extraThing: 'some value' }
    

提交回复
热议问题