Answer the question
In order to leave comments, you need to log in
How to create a dynamic menu in AngularJS?
Repetition is the mother of learning.
1. I create the ngDynamicMenu directive. The directive is designed to absorb all the logic associated with the display. Therefore, the directive will create a button-group container and fill it with buttons according to the date received from the model. That is, in html -
<ng-dynamic-menu ng-model="MenuModel.getData()"></ng-dynamic-menu>
template: <div id="button-group"></div>
element.bind('clicck', ()=>{});
Не знает по тому, что эти клики предназначаются параллельно лежащий директиве. Опять таки клик я могу доставить туда либо при помощи общего контроллера, либо при помощи сервиса. Как будет лучше?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question