mgechev / ngast

Parser for Angular projects.

Home Page:https://mgechev.github.io/ngast/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optimization proposal, getResolvedMetadata

irustm opened this issue · comments

Hi!

Can it be better to read from a file on demand?

templateMetadata.template = this.resourceResolver.getSync(templateMetadata.templateUrl);

Only when it is necessary to execute getTemplateAst?

For example, in this place?

const dirMetadata = this.getResolvedMetadata();
if (dirMetadata) {
const source = dirMetadata.template;

I don't need to get all the styles, just the template.
And if a method of obtaining is called somewhere, then take from the cache.