搜尋

首頁  >  問答  >  主體

angular.js - angular的state配置問題


程式碼截圖如上,裡面的data是用來做什麼用那?勞煩各位大神多多指教了

PHP中文网PHP中文网2855 天前635

全部回覆(2)我來回復

  • 淡淡烟草味

    淡淡烟草味2017-05-15 17:15:33

    官方文件地址
    https://ui-router.github.io/n...$stateProvider

    關於$stateProvider.state的data的解釋

    Arbitrary data object, useful for custom configuration. The parent state's data is prototypally inherited. In other words, adding a data property to a state adds it to the entire subtree viaobty inherit

    機翻

    任意資料對象,適用於自訂配置。 父狀態的資料是原型繼承的。 換句話說,將資料屬性新增至狀態透過原型繼承將其新增至整個子樹。

    簡單來說,就是路由的自訂配置,可以在控制器中拿到這個值作為一個參數

    回覆
    0
  • 世界只因有你

    世界只因有你2017-05-15 17:15:33

    雷雷

    回覆
    0
  • 取消回覆