I'm pretty new to angular and I'm doing a custom directive on angular, which will display a list, but I have no idea how to pass parameters from html to js, for example:
<div data-ng-menu="['Home','Settings','About']"></div>
and js file
var app = angular.module("myApp", []);
app.directive('ngMenu', function ($parse) {
var menu = {};
menu.restrict = 'A';
menu.template = "<ul><li>parse</li></ul>";
return menu;
});
It should display like this:
- Home
- Settings
- About