Thursday, 12 November 2015


What is ng-class-even:ng-class-even used to apply a dynamic class, on even element in ng-repeat ..
Description of ng-class-even:Basically ng-class-even is a extended/enhanced form of ng-class. limitations with ng-class-even is that it can be used within ng-repeat directive. it has 0 priority..
Syntax of ng-class-even:
<element ng-repeat="obj in list">
        <element ng-class-even="'classname'"></element>
    <table ng-repeat="obj in list">
        <td ng-class-even="'bgred'"></td>

How to Use ng-class-even/ng-class-even Example::
<div ng-app="webapp">
    <div ng-controller="angularjsexampleCtlr">
            Angularjs Example of ng-class-even
            <br />
            <table >
                    <tr data-ng-repeat="obj in list">
                        <td ng-class-even="'success'">{{}}</td>

    angular.module('webapp', []).controller('angularjsexampleCtlr', function ($scope, $http) {
        $scope.list = [{ name: 'abc', address: 'Delhi' }, { name: 'pqr', address: 'Kolkata' }, { name: 'xyz', address: 'Mumbai' },{name:'lmn',address:'Chennai'}];


No comments :

Post a Comment