-4

I have Angular code:

  $scope.updateCategory = function(cat,test) {
        res = angular.element(document.querySelector(
                $(this)
                  .parent()
                  .parent()
                  .find('.custom_cat_name')
                  .val()));
        alert(res); 

I want to get input value of $(this) of an element .

Can I do this?

Currently it is showing [object Object], which doesn't make sense.

Teq1
  • 631
  • 1
  • 6
  • 20
Hitu Bansal
  • 2,917
  • 10
  • 52
  • 87
  • I strongly advise you to read: http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background?rq=1 – Teq1 Dec 30 '14 at 13:41

1 Answers1

0

Why would you want to do that?

I assume the custom_cat_name is a class placed on an input element(that should be binded somewhere on your model).

Simply access the element from the model something like:

$scope.model.customCat

Instead of using JQuery.

Anyway, youre doing something bad by using JQuery from your controller.

Amir Popovich
  • 29,350
  • 9
  • 53
  • 99