Skip to content

Rename $event to event #8425

@felixfbecker

Description

@felixfbecker

I am so happy that Angular 2 does not prefix everything anymore with $. That was extremely annoying and unneeded in Angular 1 ($scope, $element, $scope.$apply(), $http and everyone who followed: $mdDialog, $stateProvider, ...). It comes from the legacy jQuery world were everything with a $ was cool.

In Angular 2 it is now finally just Http, ElementRef, etc. Except in _one_ case, and that is $event. Is there any reason why this is prefixed with a dollar?

When you assign a native DOM event handler like onclick="event.preventDefault()", the event object is available under event. When I do the same in Angular, I would expect the same: (click)="event.preventDefault()". Why $event? Please consider changing this (at least allow event without dollar and change the docs) before Angular 2 goes into RC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions