X Tutup
Skip to content

feat(core): provide support for relative assets for components#5634

Closed
matsko wants to merge 1 commit intoangular:masterfrom
matsko:resolve_url_new
Closed

feat(core): provide support for relative assets for components#5634
matsko wants to merge 1 commit intoangular:masterfrom
matsko:resolve_url_new

Conversation

@matsko
Copy link
Copy Markdown
Contributor

@matsko matsko commented Dec 5, 2015

Assets defined for templateUrl and styleUrls can now be loaded
in relative to where the component file is placed so long as the
moduleId is set within the component annotation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matsko you should start a career as rapper.

@IgorMinar
Copy link
Copy Markdown
Contributor

Several dart analyzer failures

@IgorMinar IgorMinar added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 5, 2015
@IgorMinar IgorMinar added this to the beta.0 milestone Dec 5, 2015
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why package if it's the application root ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Application root is too broad. It is the root where modules are loaded from.
So maybe MODULE_ROOT_URL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to MODULE_ROOT_URL.

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Dec 5, 2015

Some comments in the PR.

I am also -1 on the moduleId name in the Directive annotation. This name is CJS specific and has nothing to do with angular. What about baseUrl or something like that, independent of a given implementation ?
Also why do we need moduleId on @Directive (vs @Component)

This is not directly related to this PR

@tbosch
Copy link
Copy Markdown
Contributor

tbosch commented Dec 7, 2015

+1 for only having the moduleId on @Component
+1 for changing moduleId to something else.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't this stay final?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I was struggling with using Dart, it can't stay final because the value is determined within the body of the constructor. The error that shows up is so:

'UrlResolver' has no instance setter '_packagePrefix'.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please talk to Yegor, this should be doable

@tbosch tbosch added pr_state: LGTM and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 8, 2015
@IgorMinar
Copy link
Copy Markdown
Contributor

e2e tests are failing. looks like a legit issue.

Assets defined for `templateUrl` and `styleUrls` can now be loaded
in relative to where the component file is placed so long as the
`moduleId` is set within the component annotation.

Closes angular#5634
@mary-poppins
Copy link
Copy Markdown

Merging PR #5634 on behalf of @alexeagle to branch presubmit-alexeagle-pr-5634.

@matsko matsko closed this in db096a5 Dec 9, 2015
matsko added a commit to matsko/angular that referenced this pull request Dec 10, 2015
Assets defined for `templateUrl` and `styleUrls` can now be loaded
in relative to where the component file is placed so long as the
`moduleId` is set within the component annotation.

Closes angular#5634
@rolandjitsu
Copy link
Copy Markdown

So happy this landed 👍 Just one question, is moduleId: module.id necessary or has/will it been renamed to something else?

@IgorMinar
Copy link
Copy Markdown
Contributor

It's necessary for CJS modules.

Matias, can you send the PR with doc updates describing how to use this. I
believe that you wanted to do it in a separate PR.
On Thu, Dec 10, 2015 at 8:09 AM Roland Groza notifications@github.com
wrote:

So happy this landed [image: 👍] Just one question, is moduleId:
module.id necessary or has/will it been renamed to something else?


Reply to this email directly or view it on GitHub
#5634 (comment).

@michaeloryl
Copy link
Copy Markdown

Does this actually work? I'm trying to get it to work in beta.0 and see no impact from having moduleId: module.id in the Component decorator. And the docs still don't reflect it either, best I can find.

@matsko matsko deleted the resolve_url_new branch November 14, 2016 21:05
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

X Tutup