javascript - Error: undefined is not an object (evaluating 'this.props.menuOptions.map') -
using angular, react , reactng, error:
error: undefined not object (evaluating 'this.props.menuoptions.map')
here code:
it seems missing providing attributes in react directive element respect proptypes
passing in. because places watch on these attribute values (reflecting scope property name) , populate props accordingly.
so:
<sidebar-button menu-options="menuoptions" button-image="buttonimage" button-image-mini="buttonimagemini" menu-option-bottom="menuoptionbottom"> </sidebar-button>
doc says:
the reactdirective service read react component proptypes , watch attributes these names. if react component doesn't have proptypes defined can pass in array of attribute names watch. default, attributes watched value can choose watch reference or collection supplying watch-depth attribute. possible values reference, collection , value (default).
disclaimer: have not used ng-react before.
Comments
Post a Comment