I'm having trouble with the design pattern of a form I have in Angularjs
using ui-ruoter
.
I have a parent template which has some buttons, such as 'edit' and 'delete'. I then inside this parent have a child view which has a listing table of data as well as some other child views with tabs of data.
Upon selecting a row on this table, I want the parent view to either show or hide the 'edit' and 'delete' buttons.
I am currently using $state.params.action
to pass around what crud action is the user is doing (such as new, edit or delete) and also $state.params.id
to pass the id of the record they are editing.
How can I use ng-show
/ng-hide
to hide these?
Bear in mind that the buttons I want to hide are in ControllerA, but I want to be able to hide/show them from ControllerB (which is a child view of ControllerA).