Hi Igor,

Looks like $element has been killed. Then how do I use $mdToast to show a 
toast within one specific element? In other words, how can I get the 
controller's element and assign it to "parent" option of $mdToast? Thanks

On Saturday, 10 September 2011 02:35:05 UTC+10, Igor Minar wrote:
>
> $element is going to be killed soon. You should never do any kind of dom 
> manipulation in the controller. Use widget/directives for this purpose. 
>
> The reason why controllers should never reference the dom is because in 
> order to avoid spaghetti code and make controllers testable,  they should 
> contain just business logic of your application. 
>
> /i
> On Sep 9, 2011 6:49 AM, "Jon Lester" <[email protected] <javascript:>> 
> wrote:
> > You can access the controller's object by looking at the $element 
> property
> > of the controller. Once you have the controller you can access the DOM
> > element with $(scope.$element) where scope is your controller object.
> > 
> > Jon
> > 
> > On Fri, Sep 9, 2011 at 9:41 AM, kyma <[email protected] <javascript:>> 
> wrote:
> > 
> >> How can I access a controller's dom element, for example if I want to
> >> call a jquery function on a controller's div?
> >>
> >> --
> >> You received this message because you are subscribed to the Google 
> Groups
> >> "AngularJS" group.
> >> To post to this group, send email to [email protected] 
> <javascript:>.
> >> To unsubscribe from this group, send email to
> >> [email protected] <javascript:>.
> >> For more options, visit this group at
> >> http://groups.google.com/group/angular?hl=en.
> >>
> >>
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "AngularJS" group.
> > To post to this group, send email to [email protected] 
> <javascript:>.
> > To unsubscribe from this group, send email to 
> [email protected] <javascript:>.
> > For more options, visit this group at 
> http://groups.google.com/group/angular?hl=en.
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to