print all data in paginated table/grid

direct Tabular data display Recently our project has a page need to show tabular data from 30-6000 rows with 3-4 columns. At first, I thought this is pretty reasonable data to show in one page so I just throw the data into a ng-repeat table with my own implementation of filtering/sorting which is pretty straightforward in…

use contoller as in angularjs

The syntax when using routeprovider is: Some benefit are described here The name vm stands for View-model in mvvm

angularjs $scope form undefined

Was developing some form with angular, things work perfect until I add a angular-ui bootstrap tab to enclose 2 different form in each tab. when i try to access the form with $scope.formName, the formName is undefined. It turns out that the angularUI tab directive uses transclude which will create a child scope to the…

angularjs filter

I think it’s best to understand what we even want to learn. To do that, we need to understand what filters really are and how we use them. For me, there are four types of filters. Yes, four, but there of course can be other variants. Let’s rattle through them: Filter 1: Static (single) use…

$scope.$evalAsync() vs. $timeout() In AngularJS

Sometimes, in an AngularJS application, you have to explicitly tell AngularJS when to initiate it’s $digest() lifecycle (for dirty-data checking). This requirement is typically contained within a Directive; but, it may also be in an asynchronous Service. Most of the time, this can be easily accomplished with the $scope.$apply() method. However, some of the time,…

angularjs bootstrapui print iframe modal

1. Print modal fit in one screen If the content of the modal is in one screen, we could just put a css in the modal template to hide all other content Or put a wrap to the parent content and assign an id to it then in the print css, use the id and…

inspect angularjs scope controller in chrome(webkit)

Pick an element in the HTML panel of the developer tools and type this in the console angular.element($0).scope() In webkit $0 is a reference to the selected DOM node in the elements tab, so by doing this you get the selected DOM node scope printed out in the console Also you could assign this to…

angularjs form validation

Official documentation is pretty good. novalidate is used to disable browser’s native form validation. A form is an instance of FormController. The form instance can optionally be published into the scope using the name attribute. Similarly, an input control that has the ngModel directive holds an instance of NgModelController. Such a control instance can be…

angularjs filter on array

Use property in input’s ng model Filter is used for selecting a subset of a give array. The requirements for a filter are an array to be filtered and the predicate based on which the array need to be filtered. The predicate could be as simple as a string and let’s try filtering using a…

angularjs scope inheritence primitive object

JavaScript Prototypal Inheritance It is important to first have a solid understanding of JavaScript prototypal inheritance, especially if you are coming from a server-side background and you are more familiar with classical inheritance. So let’s review that first. Suppose parentScope has properties aString, aNumber, anArray, anObject, and aFunction. If childScope prototypically inherits from parentScope, we…