X Tutup
Skip to content

fix(compiler): strip <script> tag from templates#3486

Closed
pkozlowski-opensource wants to merge 1 commit intoangular:masterfrom
pkozlowski-opensource:tpls_remove
Closed

fix(compiler): strip <script> tag from templates#3486
pkozlowski-opensource wants to merge 1 commit intoangular:masterfrom
pkozlowski-opensource:tpls_remove

Conversation

@pkozlowski-opensource
Copy link
Copy Markdown
Member

Fixes #2766

@pkozlowski-opensource
Copy link
Copy Markdown
Member Author

Not sure if this is the best approach to "silencing" <script> tags, but my vote would go to removing them from templates altogether and this is what this PR does.

@pkozlowski-opensource pkozlowski-opensource added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 5, 2015
@naomiblack naomiblack added this to the alpha-35 milestone Aug 5, 2015
@jpsfs
Copy link
Copy Markdown

jpsfs commented Aug 6, 2015

Hi,

I understand the need for the script removal but we all know that at some point someone will put a tag script in a template and report this a bug. And I can see a use for it (if you want to load jquery plugin in that component, you can either do it via import * from "libs/myjqueryplugin" or add a tag script on the template.

@pkozlowski-opensource can you consider printing a warning message to the console, when in dev mode, to at least warn the developer about the removal of the script tags? (or give a compile error)

@pkozlowski-opensource
Copy link
Copy Markdown
Member Author

And I can see a use for it (if you want to load jquery plugin in that component, you can either do it via import * from "libs/myjqueryplugin" or add a tag script on the template.

Using <script> tags as a loader is the very thing we want to avoid here. With ES6 modules you can pull dependencies via import so there is not much reason in enabling inferior mechanism that has negative security implications

can you consider printing a warning message to the console, when in dev mode, to at least warn the developer about the removal of the script tags? (or give a compile error)

I don't think we've got good story for warning messages, so if anything, I would throw. Let's see what others got to say.

@vsavkin vsavkin added pr_state: LGTM action: merge The PR is ready for merge by the caretaker labels Aug 6, 2015
goderbauer pushed a commit to goderbauer/angular that referenced this pull request Aug 15, 2015
@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Script elements in template files should be innert

5 participants

X Tutup