Javascript [SOLVED]: Inline event handler practice javascript

Javascript [SOLVED]: Inline event handler practice javascript

Home Forums Scripting Javascript Tutorials Javascript [SOLVED]: Inline event handler practice javascript

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #245691

    Cloudy Point
    Keymaster

    QuestionQuestion

    I am reading about Events on the Mozilla, here it talks about “Inline events handlers” these should not be used and are considered a bad practice.

    e.g.

    <button onclick="bgChange()">Press me</button>
    

    However, in frameworks such as Angular we do something like:

    <my-component (click)="onClick($event)"></my-component>
    

    Is this not contradicting to what bad practice is considerd by Mozilla in this case?

    If this question needs to be asked in another section, please do let me know.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.