AngularJS - Why is there an ! in my url now?

angularjs

Note: This post applies to AngularJS. The 1.x version of Angular. Recently, I upgraded one of my apps to AngularJS 1.6 along with a bunch of other changes and a bunch of my routes broke. Unfortunately, I didn’t catch the routing issue before making a bunch of other changes. The one thing I noticed for all of the broken routes is the urls now had an #! (https://myapp.com/#!/) in them instead of just the # (https://myapp.

Read More ›

AngularJS - Calling Filters in Your Angular Controller

angularjs

Note: This post applies to AngularJS. The 1.x version of Angular. Here is a quick tip for how to call a filter from within your Angular controller. This example assumes that you already know what a filter is and have one created. Inject $filter into your controller angular.module('sample').controller('SampleController', SampleController); /* @ngInject */ function SampleController($filter) { } Call your filter by calling: View call your filter called “myFilter” on myDateVariable with arguments arg1 and arg2, you would use: <p>{{myDateVariable | myfilter : arg1 : 'arg2' }}</p> Controller call the same filter from within your controller: function SampleController($filter) { var value = $filter("myFilter")(myDateVariable, arg1, arg2); }

Read More ›

AngularJS - Communicating Between Parent And Child Scopes

angularjs

Note: This post applies to AngularJS. The 1.x version of Angular. Here is a quick tip in Angular on how to communicate between parent and child scopes. If you have a need to send notification of an event from a parent scope to a child scope, you use $scope.$broadcast to send the event. $scope.$broadcast("parent event name", dataTo Send); If you then need to send notification of an event from the child scope back to the parent scope you use $scope.

Read More ›

AngularJS In Action Book Review

angularjs/ ionic/ book reviews

Note: This post applies to AngularJS. The 1.x version of Angular. At the HolidayJs event I won a book and I picked a copy of Angular In Action by Lukas Ruebbelke. I had already been using Angular for a few projects and wasn’t expecting to get much out of the book. Honestly I got it to use as more of a give away at one of my talks but figured I would at least glance through a few chapters of it first.

Read More ›

AngularJS - Calling Service Methods from Console

angularjs

Note: This post applies to AngularJS. The 1.x version of Angular. Here is a quick tip for how you can run your Angular service and factory methods within the Chrome Dev Tools console. No longer will you have to go through the process of navigating through the UI to trigger a Service/Factory method to run. Now you can just load up the web site and do all of your debugging through the Chrome console.

Read More ›