I'm working on a test project using Bootstrap and AngularJS to (try to) make a website for one of our customers. As part of the project, I'm trying to simulate a lot of functionallity that we have in our current programs (Written in Progress Openedge). One of these functionalities is dynamically enable / disable actions depending on a user action (Like selecting another record in a grid, changing values, ...) but I'm having some trouble to get this to work.
I've made a directive to build a menu structure (based on something I found out here...) that uses an array of objects as input. Building the menu works find, I can add click events, ... but adding this disable functionallity is a problem. I've created a plunker to simulate what I'm trying to do (it uses just some buttons instead of a menu to keep it simple) here
In short, I'm trying to add an 'ng-class' attribute when the object has a disable function defined that uses that function to determine if the button should be disabled or not. In this case, when the checkbox is checked or not. When I just add the 'disabled' class it works just fine (but off course, this isn't dynamic).
I suspect I somehow have to use $compile to get this working, but $compile(element)(scope); doesn't seem to work.
So, what am I doing wrong? How can I get this to work?
As a side note, I'm rather new to Javascript / HTML / AngularJS so if I'm making some stupid mistake, feel free to point it out... ;-)
Thanks in advance...