Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

How do relative TemplateUrls work

Rado Kirov edited this page Jan 27, 2015 · 3 revisions

What you write

  1. in web/path/*.dart - templateUrl: 'more_path/foo.html'
  2. in pkg/lib/path/*.dart - templateUrl: 'more_path/foo.html' [1]

What transformer sees

  1. web/path/more_path/foo.html
  2. packages/pkg/lib/path/more_path/foo.html

What url is fetched

  1. path/more_path/foo.html
  2. /packages/pkg/path/more_path/foo.html

Urls are considered relative

  1. if they start with /
  2. if they start with package

[1] We make no difference between current package (the one on which you call pub serve/build) and dependencies here.

Clone this wiki locally