2015-06-04 39 views

回答

2

好像你缺少你的反應指令元素相對於要傳遞的propTypes提供的屬性。因爲它,然後放在這些屬性值的手錶(reflectin g範圍屬性名稱)並相應地填充道具。

所以:

<sidebar-button menu-options="menuOptions" button-image="buttonImage" 
       button-image-mini="buttonImageMini" menu-option-bottom="menuOptionBottom"> 
</sidebar-button> 

Bin

醫生說:

The reactDirective service will read the React component propTypes and watch attributes with these names. If your react component doesn't have propTypes defined you can pass in an array of attribute names to watch. By default, attributes will be watched by value however you can also choose to watch by reference or collection by supplying the watch-depth attribute. Possible values are reference, collection and value (default).

免責聲明:我沒有用之前NG反應。

+0

啊,好吧,我想如果我把值的數組看着它自動使用它們。非常感謝。 – Noah

+0

@Noah我在ngReact裏面進行調試,發現它遍歷列表並從屬性中讀取各自的屬性值。不用謝!! – PSL

相關問題