So you have some action which append html to body, yes ?

You have to $compile directive

http://stackoverflow.com/questions/11771513/angularjs-jquery-how-to-get-dynamic-content-working-in-angularjs


2014-10-02 16:24 GMT+02:00 JORDY David <[email protected]>:

> Because I worked with this library. If you have an alternative in
> Javascript (vanilla), I am ok as well
>
> Le jeudi 2 octobre 2014 16:19:31 UTC+2, JORDY David a écrit :
>
>> Hi,
>>
>> I created a directive:
>> Code :
>> Sélectionner tout
>> <http://www.developpez.net/forums/d1473186/webmasters-developpement-web/javascript-ajax-typescript-dart/javascript/bibliotheques-frameworks/ajouter-directive-jquery/#>
>>  - Visualiser dans une fenêtre à part
>> <http://www.developpez.net/forums/d1473186/webmasters-developpement-web/javascript-ajax-typescript-dart/javascript/bibliotheques-frameworks/ajouter-directive-jquery/#>
>>
>> 1
>> 2
>> 3
>> 4
>> 5
>> 6
>> 7
>> 8
>> 9
>> 10
>> 11
>> 12
>> 13
>> 14
>> 15
>> 16
>>
>>
>> angular.module('TEST').directive('helloWorld', function() {
>>         return {
>>             scope:{
>>                 name : '=',
>>                 nameStatic : '@',
>>                 select : '&'
>>             },
>>             restrict: 'AEC',
>>             replace: 'true',
>>             template: '<p ng-click="select()">Hello World!! {{name}} 
>> {{nameStatic}}</p>',
>>             link: function(scope, element, attributs){
>>                 console.log(attributs.nameStatic);
>>             }
>>         };
>>     });
>>
>> I would like with Jquery add this directive in page html page
>>
>> Code :
>> Sélectionner tout
>> <http://www.developpez.net/forums/d1473186/webmasters-developpement-web/javascript-ajax-typescript-dart/javascript/bibliotheques-frameworks/ajouter-directive-jquery/#>
>>  - Visualiser dans une fenêtre à part
>> <http://www.developpez.net/forums/d1473186/webmasters-developpement-web/javascript-ajax-typescript-dart/javascript/bibliotheques-frameworks/ajouter-directive-jquery/#>
>>
>> 1
>> 2
>>
>>
>> $("body").append("<hello-world name-static='Parametre statique' 
>> select='testDirective()' id='screenshot'/>");
>>
>> I know I have to avoid to mix angularjs and Jquery but I am doing a
>> migration.
>>
>> How can I do ?
>>
>> Thanks in advance
>>
>  --
> 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.
>

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