Skip to content

Component selector is unable to select element by id #12061

@chozzz

Description

@chozzz

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
In component decorator, selector is unable to select id by hashtag (#)

Expected behavior
Component selector should be able to select id by hashtag (#)

Minimal reproduction of the problem with instructions
Simply change you component selector by using #id

@Component({
    selector: '#top-navigation',
    templateUrl: './top-navigation.component.html',
    styleUrls: ['./top-navigation.component.scss']
})

What is the motivation / use case for changing the behavior?
Currently, I need to select it like,

@Component({
    selector: '[id=top-navigation]',
    templateUrl: './top-navigation.component.html',
    styleUrls: ['./top-navigation.component.scss']
})

Please tell us about your environment:
Ubuntu 14.04, Sublime, Webpack, Apache

  • Angular version: 2.0.X
    Angular 2.0.0
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    All browsers
  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    TypeScript 2.0.2

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