Posts

Showing posts from May, 2017

AngularJS Checkbox Select

Image
AngularJS Checkbox Select The filter   filter allows us to filter an array, and return an array containing only the matching items. This filter can only be used for arrays. In this post we will look about custom filters. Here is the implementation of custom filter, which will filter the data using array of values.It will support multiple key object with both array and single value of keys. As mentioned in angularJS API AngularJS filter Doc [1] supports multiple key filter with single value, but below custom filter will support same feature as angularJS and also supports array of values and combination of both array and single value of keys.Please find the code snippet below html: script: output: Click here to download working sample References: [1]  AngularJS Filter

AngularJS Select with ngRepeat and ngOptions

Image
AngularJS Select with ngRepeat and ngOptions HTML select element with AngularJS data-binding.  The select directive is used together with ngModel to provide data-binding between the scope and the select tag control (including setting default values). It also handles dynamic option  tag elements, which can be added using the ngRepeat or ngOptions directives. The ng-repeat directive repeats a block of HTML code for each item in an array, it can be used to create options in a dropdown list, but the ng-options directive was made especially for filling a dropdown list with options, and has at least one important advantage : Dropdowns made with ng-options allows the selected value to be an object, while dropdowns made from ng-repeat has to be a string. Choosing between ngRepeat and ngOptions In many cases, ngRepeat can be used on option  tag elements instead of ngOptions to achieve a similar result. However, ngOptions provides some benefits: more fl...

AngularJS Inline edit

Image
AngularJS Inline edit In this post, we will create a simple inline editor (in table) – clicking a button will show a text field to edit the data. We will use a controller that will initialize the models and saving the data locally. Controllers are regular JavaScript functions which are executed automatically by Angular. html: script: Click here to download working sample.