Showing posts with label AngularJS. Show all posts
Showing posts with label AngularJS. Show all posts

January 31, 2019

Angular JS: Cannot set property '_DT_CellIndex' of undefined


- This is datatable error not Angular, So you need to check datatable js file included (latest version),

- And then check table structure like no of <th> and no of <td> both must be same,

Enjoy!

January 28, 2016

AngularJs ng-click not working with datatable




Yes, normally datatable Ajax file call outside of AngularJs folder structure, If you define ng-click there then it’s not working in AngularJs.

Finally I find a best solution for AngularJs ng-click working with datatable.

Below is simple example for any Edit / Delete link:

<button onclick=\"angular.element(this).scope().recordEdit('".$id."')\">Edit</button>

In above example recordEdit is function which you can used in main js like $scope.recordEdit() function.


Enjoy!

December 26, 2015

AngularJs how to sum two dynamic value from text box?



- Please write following function in script file for sum two dynamic value from text box,

angular.module('App').filter('twosum', function() {
  return function(items) {
    var sum = 0;
    items.forEach(function(item) {
      if (item.item_count) {
         sum += item.item_count;    
      }
    })
    return sum;
  }
})

- In HTML/PHP file where you want to display above sum value write below short code,

<span>{{ table.fields | twosum }}</span>

Enjoy!

December 21, 2015

How to disable click in AngularJS?




Here is a simple example for disable click in AngularJS,

<body ng-app="ngToggle">
    <div ng-controller="AppCtrl">
        <button ng-click="disableClick(1)">Disable ng-click</button>
    </div>
</body>

In JS:

angular.module('ngToggle', [])
    .controller('AppCtrl',['$scope', function($scope){
    $scope.flag = 0;
    $scope.disableClick = function(n) {
        if (n && n !== $scope.flag) {
            $scope.flag = n;
            alert("Clicked!");
        }
        return false;
    }
}]);




DEMO


Enjoy!

December 11, 2015

Multiple ckeditor used on one page with AngularJS.



Yes, its possible to used multiple ckeditor on one page with AngularJs, please see below example OR see here

app.directive('ckEditor', [function () {
    return {
        require: '?ngModel',
        link: function ($scope, elm, attr, ngModel) {

            var ck = CKEDITOR.replace(elm[0]);

            ck.on('pasteState', function () {
                $scope.$apply(function () {
                    ngModel.$setViewValue(ck.getData());
                });
            });

            ngModel.$render = function (value) {
                ck.setData(ngModel.$modelValue);
            };
        }
    };
}])

Enjoy!

November 6, 2015

About AngularJS.



Finally now I start work on AngularJS. I like this javascript Framework.

AngularJS is open source, completely free to used. For use of AngularJS you need just basic knowledge of javascript, Ajax and HTML.

Here I display basic example of AngularJS:

<!doctype html>
<html ng-app>
 
   <head>
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script>
   </head>
 
   <body>
      <div>
         <label>My Name:</label>
         <input type = "text" ng-model = "MyName" placeholder = "Enter a name here">
         <hr />
       
         <h1>Hello {{MyName}}!</h1>
      </div>
     
   </body>
</html>

Enjoy!

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...