For example you have 50 button that have class classButton, what will you do to listen click on them ?
On Friday, January 10, 2014 2:27:50 AM UTC+1, biloki wrote: > > classButton is just an example that I name. You can't add ng-click for all > buttons, it's too long. It has to have a solution dynamic like jquery > > On Friday, January 10, 2014 2:23:58 AM UTC+1, Kijana Woodard wrote: >> >> I'm new to angular as well. I suppose you are trying to bridge what you >> know in order to learn something new. >> >> My approach has been to dump what I know and learn the idioms of angular >> first. Ymmv. >> >> So I would put ng-click on the button until I understood what angular has >> to offer. >> >> I would use scm to merge my changes with the html dev if they can't/won't >> so angular. >> >> Fwiw, I would never have a class named classButton. >> On Jan 9, 2014 7:11 PM, "biloki" <[email protected]> wrote: >> >>> So just simple question: in angular, how do you bind event click on >>> class with the name is classButton ? >>> >>> On Friday, January 10, 2014 1:53:37 AM UTC+1, Kijana Woodard wrote: >>>> >>>> Why use angular like jquery? Why not use angular like angular....or use >>>> jquery. >>>> >>>> https://groups.google.com/forum/#!msg/angular/kqZDVSUlkd0/sge6KsaaKQAJ >>>> >>>> >>>> On Thu, Jan 9, 2014 at 6:17 PM, biloki <[email protected]> wrote: >>>> >>>>> What do you mean ? I know: to add event click on an element, I add >>>>> directly event on element, for ex: >>>>> >>>>> <div id="div1" ng-click="clickFunction()"></div> >>>>> >>>>> But it's not dynamic, I find the dynamic way like jquery like: >>>>> >>>>> $("#div1").bind('click',function(){}) >>>>> $(".button").bind('click',function(){}) >>>>> >>>>> So is there any way to do that in angularjs ? >>>>> >>>>> >>>>> On Friday, January 10, 2014 1:03:56 AM UTC+1, Kijana Woodard wrote: >>>>> >>>>>> http://docs.angularjs.org/guide/concepts >>>>>> >>>>>> >>>>>> On Thu, Jan 9, 2014 at 6:00 PM, biloki <[email protected]> wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I'm beginner of Angularjs. Normally by jquery, to bind an event for >>>>>>> the HTML element, I do like this: >>>>>>> >>>>>>> $( "#foo" ).bind( "click", *function*() { >>>>>>> >>>>>>> alert( "User clicked on 'foo.'" ); >>>>>>> >>>>>>> }); >>>>>>> >>>>>>> I'm using Angular in my project, so how to bind the event to the >>>>>>> element like jquery in angular ? >>>>>>> >>>>>>> Anyone can help me >>>>>>> >>>>>>> Thank you >>>>>>> >>>>>>> -- >>>>>>> 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/groups/opt_out. >>>>>>> >>>>>> >>>>>> -- >>>>> 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/groups/opt_out. >>>>> >>>> >>>> -- >>> 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/groups/opt_out. >>> >> -- 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/groups/opt_out.
