I am trying to open the modal dialog from javascript when a certain condition is met. The example shown here http://angular-ui.github.io/bootstrap/ invokes the modal on ng-click.
How do I achieve showing modal when a certain condition is met?
Thanks
Additional Info
Sorry didn't mean to create confusion. I am going to clarify a little bit more by saying what I meant by "certain condition". The scenario is the user will search for customer by name and will get a list of customers back matching with the search string. The user then clicks on any one of the customer row to get more detail information.
When clicked the code control is handed off to Controller (It's an ASP.Net MVC app) which will then go through other classes and finally get data of the customer from database. It will then populate a boolean property called spouseNotFound. It then returns the JSON back to angularjs controller. Now assume that if this particular customer does not have spouse I want to show a modal saying that "Spouse not found".
So, no, I don't want the modal to be invoked on an event, rather than on business rule condition.
Hope that helps to understand things clearly.
click
event is a condition (if click then ...), so OP's question does indeed show lack of any substantial effort. – Stewie Jan 10 '14 at 8:42($scope.prop1 && $scope.prop2)
is more appropriately described as a condition. Normally the click EVENT would drive the opening of the modal. He even says "The example shown here angular-ui.github.io/bootstrap invokes the modal on ng-click," as in, "I see this documentation here, but I'm not certain how to apply to my case." – C Fairweather Jan 10 '14 at 17:15