Multiple transform properties not working in template
I want to build a very simple editor which allows a user to transform a background image.
For this purpose I am setting transform
like this:
<img [style.transform]="'translate(50%,50%) rotate(45deg)'">
The problem is that if I set both, translate
and rotate
, the style is not getting applied. I can set them alone but not together.
Is it possible to do this somehow?
Here is a stackblitz
angular
|
show 5 more comments
I want to build a very simple editor which allows a user to transform a background image.
For this purpose I am setting transform
like this:
<img [style.transform]="'translate(50%,50%) rotate(45deg)'">
The problem is that if I set both, translate
and rotate
, the style is not getting applied. I can set them alone but not together.
Is it possible to do this somehow?
Here is a stackblitz
angular
Please provide a Minimal, Complete, and Verifiable example reproducing the issue.
– trichetriche
Nov 12 at 12:32
@trichetriche That's one line of HTML but there you go ..
– Stefan Falk
Nov 12 at 12:37
And does that one line of HTML tells us what you provide forleft, top, rotate
? Thank you, I'll take a look at it
– trichetriche
Nov 12 at 12:38
1
The console showed a warning that I googled. It seems to be solvable by using [ngStyle] instead of [style.*]
– ShamPooSham
Nov 12 at 12:41
1
No problem ! Other people provided you with an answer, as you can see in the console your issue is with the sanitization of your strings. You should be able to find resources in the documentation with the given URL, or as @ShamPooSham suggested, in another question. Hope you resolve your issue !
– trichetriche
Nov 12 at 12:45
|
show 5 more comments
I want to build a very simple editor which allows a user to transform a background image.
For this purpose I am setting transform
like this:
<img [style.transform]="'translate(50%,50%) rotate(45deg)'">
The problem is that if I set both, translate
and rotate
, the style is not getting applied. I can set them alone but not together.
Is it possible to do this somehow?
Here is a stackblitz
angular
I want to build a very simple editor which allows a user to transform a background image.
For this purpose I am setting transform
like this:
<img [style.transform]="'translate(50%,50%) rotate(45deg)'">
The problem is that if I set both, translate
and rotate
, the style is not getting applied. I can set them alone but not together.
Is it possible to do this somehow?
Here is a stackblitz
angular
angular
edited Nov 12 at 12:44
asked Nov 12 at 12:29
Stefan Falk
6,3491579164
6,3491579164
Please provide a Minimal, Complete, and Verifiable example reproducing the issue.
– trichetriche
Nov 12 at 12:32
@trichetriche That's one line of HTML but there you go ..
– Stefan Falk
Nov 12 at 12:37
And does that one line of HTML tells us what you provide forleft, top, rotate
? Thank you, I'll take a look at it
– trichetriche
Nov 12 at 12:38
1
The console showed a warning that I googled. It seems to be solvable by using [ngStyle] instead of [style.*]
– ShamPooSham
Nov 12 at 12:41
1
No problem ! Other people provided you with an answer, as you can see in the console your issue is with the sanitization of your strings. You should be able to find resources in the documentation with the given URL, or as @ShamPooSham suggested, in another question. Hope you resolve your issue !
– trichetriche
Nov 12 at 12:45
|
show 5 more comments
Please provide a Minimal, Complete, and Verifiable example reproducing the issue.
– trichetriche
Nov 12 at 12:32
@trichetriche That's one line of HTML but there you go ..
– Stefan Falk
Nov 12 at 12:37
And does that one line of HTML tells us what you provide forleft, top, rotate
? Thank you, I'll take a look at it
– trichetriche
Nov 12 at 12:38
1
The console showed a warning that I googled. It seems to be solvable by using [ngStyle] instead of [style.*]
– ShamPooSham
Nov 12 at 12:41
1
No problem ! Other people provided you with an answer, as you can see in the console your issue is with the sanitization of your strings. You should be able to find resources in the documentation with the given URL, or as @ShamPooSham suggested, in another question. Hope you resolve your issue !
– trichetriche
Nov 12 at 12:45
Please provide a Minimal, Complete, and Verifiable example reproducing the issue.
– trichetriche
Nov 12 at 12:32
Please provide a Minimal, Complete, and Verifiable example reproducing the issue.
– trichetriche
Nov 12 at 12:32
@trichetriche That's one line of HTML but there you go ..
– Stefan Falk
Nov 12 at 12:37
@trichetriche That's one line of HTML but there you go ..
– Stefan Falk
Nov 12 at 12:37
And does that one line of HTML tells us what you provide for
left, top, rotate
? Thank you, I'll take a look at it– trichetriche
Nov 12 at 12:38
And does that one line of HTML tells us what you provide for
left, top, rotate
? Thank you, I'll take a look at it– trichetriche
Nov 12 at 12:38
1
1
The console showed a warning that I googled. It seems to be solvable by using [ngStyle] instead of [style.*]
– ShamPooSham
Nov 12 at 12:41
The console showed a warning that I googled. It seems to be solvable by using [ngStyle] instead of [style.*]
– ShamPooSham
Nov 12 at 12:41
1
1
No problem ! Other people provided you with an answer, as you can see in the console your issue is with the sanitization of your strings. You should be able to find resources in the documentation with the given URL, or as @ShamPooSham suggested, in another question. Hope you resolve your issue !
– trichetriche
Nov 12 at 12:45
No problem ! Other people provided you with an answer, as you can see in the console your issue is with the sanitization of your strings. You should be able to find resources in the documentation with the given URL, or as @ShamPooSham suggested, in another question. Hope you resolve your issue !
– trichetriche
Nov 12 at 12:45
|
show 5 more comments
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53262234%2fmultiple-transform-properties-not-working-in-template%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53262234%2fmultiple-transform-properties-not-working-in-template%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please provide a Minimal, Complete, and Verifiable example reproducing the issue.
– trichetriche
Nov 12 at 12:32
@trichetriche That's one line of HTML but there you go ..
– Stefan Falk
Nov 12 at 12:37
And does that one line of HTML tells us what you provide for
left, top, rotate
? Thank you, I'll take a look at it– trichetriche
Nov 12 at 12:38
1
The console showed a warning that I googled. It seems to be solvable by using [ngStyle] instead of [style.*]
– ShamPooSham
Nov 12 at 12:41
1
No problem ! Other people provided you with an answer, as you can see in the console your issue is with the sanitization of your strings. You should be able to find resources in the documentation with the given URL, or as @ShamPooSham suggested, in another question. Hope you resolve your issue !
– trichetriche
Nov 12 at 12:45