Contents tagged with AngularJS

  • Creating Your Own Custom Angular Maxlength Directive For Readonly Restrictions

    Here's an example - you've got a field (eg, for customer comments) where you'd like to limit the maximum number of characters entered on the frontend. Pretty simple, you just throw on ng-maxlength, right? <textarea class="form-control msd-elastic" ng-model="comments" ng-maxlength="100" name="comments"></textarea> But now, you also want … more

  • Debugging the Angular JS Routing Lifecycle

    On the first day at my new job at Tailster, I threw myself at diagnosing an Angular JS bug, despite my general lack of knowledge and experience in Angular. Long story short, if you ever need to trace what route and what controllers are being called, you can add the following code to your your rootscope function: $rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, … more

  • 1