This is so weird and I have no idea why this simple script is not working. I'm still pretty new to Angular after living with jQuery and Backbone.
Here's the basic code structure ...
<div class="span10" ng-controller="ClientCtrl" ng-hide="addClient"> <button ng-click="addClient = true" class="btn btn-primary"> Add new Client </button> </div> <div class="span10" ng-controller="ClientCtrl" ng-show="addClient"> <div ng-include src="'views/partials/client.html'"></div> </div>
The expected behavior is that clicking the Add New Client button will show the second div. The actual behavior is that the first div is hidden (as it should), but the second div remains hidden. There is no control behavior in the controller.
I tried this with the scope function, setting the initial property in the controller and many other things with no luck. What am I doing wrong? I checked to make sure that they are on the same level and that does not seem to be a "problem". Thanks for the help because it drives me crazy.
source share