Polymer/old-docs-site

importPath undefined

Open

#2,466 创建于 2018年2月6日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)HTML (2,482 fork)batch import
2.xP2docsgood first issueneeds documentation

仓库指标

Star
 (1,013 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

From @DarkSideOfMo0n on January 26, 2018 14:6

Description

Documentation says: import Path -> "A static getter on the element class that defaults to the element HTML import document URL and is overridable. It may be useful to override importPath when an element's template is not retrieved from a or the element is not defined using an HTML import." can be found here, section: URLs in templates

But it seems that when using a component with inline template this importPath property is undefined.

Live Demo

repo URL: https://github.com/DarkSideOfMo0n/import-path-bug

Steps to Reproduce

  1. git clone https://github.com/DarkSideOfMo0n/import-path-bug.git
  2. bower install
  3. polymer serve
  4. open index.html in browser
  5. inspect my-element -> importPath property is undefined

Expected Results

importPath property of my-element contains the path it was imported from

Actual Results

importPath property of my-element is undefined

Browsers Affected

  • [X ] Chrome
  • Firefox
  • Edge
  • Safari 9
  • Safari 8
  • IE 11

Versions

  • Polymer: v2.3.1
  • webcomponents: v1.1.0

Copied from original issue: Polymer/polymer#5064

贡献者指南