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!

6 comments:

  1. Hi,

    Thank for help full post its save my time and money,

    I have a question like if I want to edit record then how automatically assign all value to form?

    Can you give main app.js function code where you write this $scope.recordEdit() function?

    :)

    ReplyDelete
  2. YOU ARE A HERO. DON'T MATTER WHAT THEY SAY.

    ReplyDelete
  3. thank you so much, you save my time..
    your code work with my laravel datatable with angular.
    so helpful really..
    many thanks!

    ReplyDelete

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...