Thanks for your help.

Meanwhile I had converted all my jquery event logic  to angular on my 
Controller.
 $scope.onMouseEnter = function ($event) {
        var coords = getMouseEventResult($event, "Mouse move");

        var newElement = $compile('div id="screenshot"> <muse:hello-world 
name-static="Parametre statique2" 
select="testDirective()"/></div>')($scope);
        angular.element(document.body).append(newElement);
    };

But nothing happens. What I have forgotten ?


Le vendredi 3 octobre 2014 10:04:03 UTC+2, korneliusz wilgocki a écrit :
>
> <!doctype html>
> <html ng-app="app">
>   <head>
>   <script src="
> https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
> "></script>
>         <script src="
> https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.4/angular.min.js
> "></script>
>     
>   </head>
>   <body ng-controller="MyController">
>
>   </body>
> </html>
>
>
> <script>
>
> angular.module('app', [])
> .controller('MyController', ['$scope', function($scope {
> $scope.test = 'test';
> }])
> .directive('helloWorld', function() {
> return {
> scope:{       
> nameStatic : '@', 
> select : '&'        
> },
> restrict: 'E',
> replace: 'true',
> template: '<p ng-click="select()">Hello World!! {{nameStatic}}</p>',
> link: function(scope, element, attributs){
> console.log(attributs.nameStatic);
> }
> };
> });
>   
>
> var element = "<hello-world name-static='Parametre statique' 
> select='testDirective()' id='screenshot'></hello-world>";
> $('body').append(element);
>
> var scope = angular.element('body').scope();
> scope.$apply();
>
> </script>
>
> 2014-10-03 8:19 GMT+02:00 JORDY David <[email protected] 
> <javascript:>>:
>
>> I am really lost, do you have an example a fiddler ?
>>
>> Le jeudi 2 octobre 2014 16:28:35 UTC+2, korneliusz wilgocki a écrit :
>>>
>>> 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 
>>> <http://www.google.com/url?q=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F11771513%2Fangularjs-jquery-how-to-get-dynamic-content-working-in-angularjs&sa=D&sntz=1&usg=AFQjCNGQXORFbcwpdh4lvNQofNMAKXSN6A>
>>>
>>>
>>> 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] <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/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