ng-cache-loader
ng-cache-loader copied to clipboard
How to have multiple root for prefix
How can I have multiple root for prefix?
For example: /User/packman/Projects/packman/ ├─ app/tmpls/field.html └─ components/tmpls/yellow.html
loader: "ng-cache?prefix=app and components:**" //can have // => ng-include="'tmpls/field.html'" //or // => ng-include="'tmpls/yellow.html'"
You should define prefix=*
or the same prefix=[dir]
. This takes one rightmost directory from path.
There is root
parameter. It is used to strip path left (including root). In contrast, prefix map path from right to left. Placeholders in prefix are replaced with real directory names.
For instance:
ng-cache?prefix=*/templates
//can have
// => ng-include="'app/templates/field.html'"
//or
// => ng-include="'components/templates/yellow.html'"