Invoking modal window in AngularJS Bootstrap UI using JavaScript

OK, so first of all the http://angular-ui.github.io/bootstrap/ has a <modal> directive and the $dialog service and both of those can be used to open modal windows. The difference is that with the <modal> directive content of a modal is embedded in a hosting template (one that triggers modal window opening). The $dialog service is far … Read more

Angular-UI Router: Nested Views Not Working

I created working plunker here NOTE: You should read about state nesting and named views more. Because the current state and view definition is simply wrong. Nested States & Nested Views Multiple Named Views Firstly, we should not use the ONE state definition with many views: {}. But we should split them into real states. … Read more

angularjs share data config between controllers

Consider the method described by this post: Extending AngularJS Controllers Using the Mixin Pattern Instead of copying your methods out of a service, create a base controller that contains those methods, and then call extend on your derived controllers to mix them in. The example from the post: function AnimalController($scope, vocalization, color, runSpeed) { var … Read more

Mocking $modal in AngularJS unit tests

When you spy on the $modal.open function in the beforeEach, spyOn($modal, ‘open’).andReturn(fakeModal); or spyOn($modal, ‘open’).and.returnValue(fakeModal); //For Jasmine 2.0+ you need to return a mock of what $modal.open normally returns, not a mock of $modal, which doesn’t include an open function as you laid out in your fakeModal mock. The fake modal must have a result … Read more

Using Bootstrap for Angular and Material design for Angular together

If you add both bootstrap & angular-material this is what will happen Both have css which will target your front end elements (e.g. input element, buttons) Each have their own look & feel (i.e. Bootstrap input element is different from Material input element). So, your overall project won’t have one single look & feel. If … Read more

Can you override specific templates in AngularUI Bootstrap?

Yes, directives from http://angular-ui.github.io/bootstrap are highly customizable and it is easy to override one of the templates (and still rely on the default ones for other directives). It is enough to feed $templateCache, either feeding it directly (as done in the ui-bootstrap-tpls file) or – probably simpler – override a template using the <script> directive … Read more