Yes, I want to do it on the class or id of div dynamically. When we works 
on projects javascript. We have a designer who do the file html and 
developer writes javascript. I don't want the designer adds direct 
ng-click, ng-change directly on the element html, developer will define in 
file js like I did in jquery: $('.okButton').bind('click',function)... 

So I want to do the similar by angular. So angular can do that ? Or I have 
to do that by jquery ?

On Friday, January 10, 2014 1:33:30 AM UTC+1, tonypee wrote:
>
> By 'dynamic' you mean that you can do it on a selector link '.myClass' for 
> all 'types' of button. 
>
> Otherwise your example on the id is just as static (hopefully there is 
> only 1 element with that id) 
>
> Its not really the right way of thinking i feel, but you *could* look at 
> creating a directive that would assign certain selectors to handlers - and 
> this would just use jquery.
>
> eg:  <div bind-to-selector="{ '.someting':handler() }"  
>
> but you probably dont want to go down that path. sounds confusing.
>
>
>
>
>
>
>
> On Thu, Jan 9, 2014 at 4:17 PM, biloki <[email protected] 
> <javascript:>>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] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Tony Polinelli
>
>  

-- 
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.

Reply via email to