Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$compile fails on leading whitespace of template string #4272

@mlynch

Description

@mlynch

If you have a template with leading whitespace, or any string that does not start with an opening angle bracket (<), $compile will fail inside of the JQLite constructor with a nonsel error: http://docs.angularjs.org/error/jqLite:nosel

The relevant line is here:

if (isString(element) && element.charAt(0) != '<') {

I understand it's hard to infer what the user wants, but there are two issues: that supplied template content needs to be trimmed and this is not specified in the docs, and that the error message is very opaque.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions