diff --git a/src/app/learn/get-started/advanced/include-static-assets/index.html b/src/app/learn/get-started/advanced/include-static-assets/index.html index 6b927e63e..6b8883e87 100644 --- a/src/app/learn/get-started/advanced/include-static-assets/index.html +++ b/src/app/learn/get-started/advanced/include-static-assets/index.html @@ -9,7 +9,7 @@ - Include a static asset on a page + Include a static asset from a component's template or style sheet
    @@ -20,17 +20,14 @@
  1. - On the file where you want to include the static asset, reference the static asset with ~/assets/ before the filename and path. -

    -

    - References to static assets must start with ~/assets/ for the SkyAppAssetsService to retrieve the assets from the src/assets folder because the filenames are updated at build time to include hashes that represent the content of the files. + On the file where you want to include the static asset, reference the static asset with a root-relative path, such as /assets/img/example.jpg.

    For example, you can display an image on a page.

    - Photo + Photo

    @@ -38,7 +35,7 @@

    @@ -48,6 +45,28 @@
+ + Include a static asset from a global style sheet + + +
    +
  1. +

    + On the style sheet where you want to include the static asset, reference the static asset with a document-relative path, such as assets/img/example.jpg. +

    +

    + For example, you can display an image on a page. +

    + + .foo-global { + height: 500px; + width: 500px; + background-image: url(assets/img/example.jpeg); + } + +
  2. +
+ Retrieve a static asset with SkyAppAssetsService @@ -71,7 +90,7 @@
  • - In the getUrl method, specify the path and file name for the static asset. Do not include the ~/assets prefix, and note that param is case-sensitive. + In the getUrl method, specify the path and file name for the static asset. Do not include the /assets prefix, and note that param is case-sensitive.

    skyAppAssetsService.getUrl('json/example.json')