Finding the name of the Control attached to a element in CanJs

362 views Asked by At

I am using Canjs to build my Web application . Now i have a issue while i am working on it.

The controllers get changed on a Single HTML element and the controllers that got attached to that particular element does not get destroyed when the new controller gets attached. So i decided to destroy all the controllers attached to that before I attach something else to it.

I am left with two queries

  1. How do i find the attached controllers on a particular element ? as .controller() doesn't work

  2. How do i call the destroy?

Please help me Thanks in Advance .

1

There are 1 answers

3
Daff On BEST ANSWER

If you are using the can.Control.plugin plugin it should be possible to access all the controls on an element by calling $(element).controls().