Compile AngularJS pages and remove ng-* directivesHow does data binding work in AngularJS?'this' vs $scope in AngularJS controllersHow do I access the $scope variable in browser's console using AngularJS?What is the difference between '@' and '=' in directive scope in AngularJS?“Thinking in AngularJS” if I have a jQuery background?How do I use $scope.$watch and $scope.$apply in AngularJS?AngularJS: Service vs provider vs factoryLink vs compile vs controllerAdding parameter to ng-click function inside ng-repeat doesn't seem to workAngular directives - when and how to use compile, controller, pre-link and post-link

Did Apollo leave poop on the moon?

How can I tell if a flight itinerary is fake

ESTA declined to the US

Is it true that control+alt+delete only became a thing because IBM would not build Bill Gates a computer with a task manager button?

How to help new students accept function notation

4-dimensional Knight's Tour

Does the United States guarantee any unique freedoms?

sytemctl status log output

Where to pee in London?

Short story about a teenager who has his brain replaced with a microchip (Psychological Horror)

Is Odin inconsistent about the powers of Mjolnir?

Validation and verification of mathematical models

Could one become a successful researcher by writing some really good papers while being outside academia?

Can I enter a rental property without giving notice if I'm afraid a tenant may be hurt?

Premier League simulation

I was contacted by a private bank overseas to get my inheritance

Is it allowed and safe to carry a passenger / non-pilot in the front seat of a small general aviation airplane?

What word can be used to describe a bug in a movie?

Does the length of a password for Wi-Fi affect speed?

Is it double speak?

What was the first multiprocessor x86 motherboard?

Is there a loss of quality when converting RGB to HEX?

Does bottle color affect mold growth?

How can glass marbles naturally occur in a desert?



Compile AngularJS pages and remove ng-* directives


How does data binding work in AngularJS?'this' vs $scope in AngularJS controllersHow do I access the $scope variable in browser's console using AngularJS?What is the difference between '@' and '=' in directive scope in AngularJS?“Thinking in AngularJS” if I have a jQuery background?How do I use $scope.$watch and $scope.$apply in AngularJS?AngularJS: Service vs provider vs factoryLink vs compile vs controllerAdding parameter to ng-click function inside ng-repeat doesn't seem to workAngular directives - when and how to use compile, controller, pre-link and post-link






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Is it possible to compile AngularJS application to remove ng-* directives like (ng-click) and generate plain HTML like Angular 2+? If we inspect Angular 2 application with say chrome dev tools, it does not show event handlers like onClick. However AngularJS shows ng-click, ng-for etc.










share|improve this question


























  • What is the reason? just to make the dom cleaner? if so, this is the way AngularJS works :]

    – felixmosh
    Mar 27 at 7:14

















0















Is it possible to compile AngularJS application to remove ng-* directives like (ng-click) and generate plain HTML like Angular 2+? If we inspect Angular 2 application with say chrome dev tools, it does not show event handlers like onClick. However AngularJS shows ng-click, ng-for etc.










share|improve this question


























  • What is the reason? just to make the dom cleaner? if so, this is the way AngularJS works :]

    – felixmosh
    Mar 27 at 7:14













0












0








0








Is it possible to compile AngularJS application to remove ng-* directives like (ng-click) and generate plain HTML like Angular 2+? If we inspect Angular 2 application with say chrome dev tools, it does not show event handlers like onClick. However AngularJS shows ng-click, ng-for etc.










share|improve this question
















Is it possible to compile AngularJS application to remove ng-* directives like (ng-click) and generate plain HTML like Angular 2+? If we inspect Angular 2 application with say chrome dev tools, it does not show event handlers like onClick. However AngularJS shows ng-click, ng-for etc.







angularjs angular angularjs-directive






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 9:14









jowey

1,1221 gold badge11 silver badges30 bronze badges




1,1221 gold badge11 silver badges30 bronze badges










asked Mar 27 at 5:56









Kiran KyleKiran Kyle

285 bronze badges




285 bronze badges















  • What is the reason? just to make the dom cleaner? if so, this is the way AngularJS works :]

    – felixmosh
    Mar 27 at 7:14

















  • What is the reason? just to make the dom cleaner? if so, this is the way AngularJS works :]

    – felixmosh
    Mar 27 at 7:14
















What is the reason? just to make the dom cleaner? if so, this is the way AngularJS works :]

– felixmosh
Mar 27 at 7:14





What is the reason? just to make the dom cleaner? if so, this is the way AngularJS works :]

– felixmosh
Mar 27 at 7:14












1 Answer
1






active

oldest

votes


















0














Short answer:

No.



Long answer:

I won't prvide one, as your question touches many (complex) topics that are already explained elsewhere and possibliy better than I could do, but I will provide some usefull links in my short explanation.



Medium answer:

What you asking for is not possible, because AngularJS uses a different approach for change detection and event bindings.



One of the cool things about AngularJS/Angular is it's ability to to detect changes and perform updates automtically. To make this possible, Angular(JS) has to notice if things change.



Taking your example with the click event, AngularJS uses event based directives to notice the click event, whereas Angular performs a event binding using one-way bindng from the template view to the component. Angular has this possibility because it uses Zones to get aware of changes. Therefore it doesn't need a directive as AngularJS did.



This explains why you don't see event handlers on the HTML element, because Angular directly sets up the event binding. You can verify that the event is handled by Zone.js if you check the Event Listeners tab in Chrome:
Click event gets handeled by Zone.js



Other usefull links to the topic:



  • https://angular.io/guide/architecture-components#data-binding

  • https://blog.thoughtram.io/angular/2016/01/22/understanding-zones.html





share|improve this answer


























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370657%2fcompile-angularjs-pages-and-remove-ng-directives%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Short answer:

    No.



    Long answer:

    I won't prvide one, as your question touches many (complex) topics that are already explained elsewhere and possibliy better than I could do, but I will provide some usefull links in my short explanation.



    Medium answer:

    What you asking for is not possible, because AngularJS uses a different approach for change detection and event bindings.



    One of the cool things about AngularJS/Angular is it's ability to to detect changes and perform updates automtically. To make this possible, Angular(JS) has to notice if things change.



    Taking your example with the click event, AngularJS uses event based directives to notice the click event, whereas Angular performs a event binding using one-way bindng from the template view to the component. Angular has this possibility because it uses Zones to get aware of changes. Therefore it doesn't need a directive as AngularJS did.



    This explains why you don't see event handlers on the HTML element, because Angular directly sets up the event binding. You can verify that the event is handled by Zone.js if you check the Event Listeners tab in Chrome:
    Click event gets handeled by Zone.js



    Other usefull links to the topic:



    • https://angular.io/guide/architecture-components#data-binding

    • https://blog.thoughtram.io/angular/2016/01/22/understanding-zones.html





    share|improve this answer































      0














      Short answer:

      No.



      Long answer:

      I won't prvide one, as your question touches many (complex) topics that are already explained elsewhere and possibliy better than I could do, but I will provide some usefull links in my short explanation.



      Medium answer:

      What you asking for is not possible, because AngularJS uses a different approach for change detection and event bindings.



      One of the cool things about AngularJS/Angular is it's ability to to detect changes and perform updates automtically. To make this possible, Angular(JS) has to notice if things change.



      Taking your example with the click event, AngularJS uses event based directives to notice the click event, whereas Angular performs a event binding using one-way bindng from the template view to the component. Angular has this possibility because it uses Zones to get aware of changes. Therefore it doesn't need a directive as AngularJS did.



      This explains why you don't see event handlers on the HTML element, because Angular directly sets up the event binding. You can verify that the event is handled by Zone.js if you check the Event Listeners tab in Chrome:
      Click event gets handeled by Zone.js



      Other usefull links to the topic:



      • https://angular.io/guide/architecture-components#data-binding

      • https://blog.thoughtram.io/angular/2016/01/22/understanding-zones.html





      share|improve this answer





























        0












        0








        0







        Short answer:

        No.



        Long answer:

        I won't prvide one, as your question touches many (complex) topics that are already explained elsewhere and possibliy better than I could do, but I will provide some usefull links in my short explanation.



        Medium answer:

        What you asking for is not possible, because AngularJS uses a different approach for change detection and event bindings.



        One of the cool things about AngularJS/Angular is it's ability to to detect changes and perform updates automtically. To make this possible, Angular(JS) has to notice if things change.



        Taking your example with the click event, AngularJS uses event based directives to notice the click event, whereas Angular performs a event binding using one-way bindng from the template view to the component. Angular has this possibility because it uses Zones to get aware of changes. Therefore it doesn't need a directive as AngularJS did.



        This explains why you don't see event handlers on the HTML element, because Angular directly sets up the event binding. You can verify that the event is handled by Zone.js if you check the Event Listeners tab in Chrome:
        Click event gets handeled by Zone.js



        Other usefull links to the topic:



        • https://angular.io/guide/architecture-components#data-binding

        • https://blog.thoughtram.io/angular/2016/01/22/understanding-zones.html





        share|improve this answer















        Short answer:

        No.



        Long answer:

        I won't prvide one, as your question touches many (complex) topics that are already explained elsewhere and possibliy better than I could do, but I will provide some usefull links in my short explanation.



        Medium answer:

        What you asking for is not possible, because AngularJS uses a different approach for change detection and event bindings.



        One of the cool things about AngularJS/Angular is it's ability to to detect changes and perform updates automtically. To make this possible, Angular(JS) has to notice if things change.



        Taking your example with the click event, AngularJS uses event based directives to notice the click event, whereas Angular performs a event binding using one-way bindng from the template view to the component. Angular has this possibility because it uses Zones to get aware of changes. Therefore it doesn't need a directive as AngularJS did.



        This explains why you don't see event handlers on the HTML element, because Angular directly sets up the event binding. You can verify that the event is handled by Zone.js if you check the Event Listeners tab in Chrome:
        Click event gets handeled by Zone.js



        Other usefull links to the topic:



        • https://angular.io/guide/architecture-components#data-binding

        • https://blog.thoughtram.io/angular/2016/01/22/understanding-zones.html






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 27 at 7:27

























        answered Mar 27 at 7:21









        joweyjowey

        1,1221 gold badge11 silver badges30 bronze badges




        1,1221 gold badge11 silver badges30 bronze badges





















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370657%2fcompile-angularjs-pages-and-remove-ng-directives%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해