unsafe value used in a resource URL context
up vote
0
down vote
favorite
I'm new to Angular 6 and I'm getting this error:
"unsafe value used in a resource URL context (see
http://g.co/ng/security#xss)"
I have searched allot and found that to fix this issue need to create a pipe in angular which i did and created new pipe then changed code in html but still issue persists can any person guide me?
Changed Iframe code as show below after creating new pipe:
<iframe src="http://localhost:8087/bim/api/v1/dashboardTree/{{companyId}} |safe"></iframe>
The code of the pipe:
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
@Pipe({
name: 'tree'
})
export class TreePipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) {}
transform(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
node.js angular angular6
New contributor
add a comment |
up vote
0
down vote
favorite
I'm new to Angular 6 and I'm getting this error:
"unsafe value used in a resource URL context (see
http://g.co/ng/security#xss)"
I have searched allot and found that to fix this issue need to create a pipe in angular which i did and created new pipe then changed code in html but still issue persists can any person guide me?
Changed Iframe code as show below after creating new pipe:
<iframe src="http://localhost:8087/bim/api/v1/dashboardTree/{{companyId}} |safe"></iframe>
The code of the pipe:
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
@Pipe({
name: 'tree'
})
export class TreePipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) {}
transform(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
node.js angular angular6
New contributor
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm new to Angular 6 and I'm getting this error:
"unsafe value used in a resource URL context (see
http://g.co/ng/security#xss)"
I have searched allot and found that to fix this issue need to create a pipe in angular which i did and created new pipe then changed code in html but still issue persists can any person guide me?
Changed Iframe code as show below after creating new pipe:
<iframe src="http://localhost:8087/bim/api/v1/dashboardTree/{{companyId}} |safe"></iframe>
The code of the pipe:
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
@Pipe({
name: 'tree'
})
export class TreePipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) {}
transform(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
node.js angular angular6
New contributor
I'm new to Angular 6 and I'm getting this error:
"unsafe value used in a resource URL context (see
http://g.co/ng/security#xss)"
I have searched allot and found that to fix this issue need to create a pipe in angular which i did and created new pipe then changed code in html but still issue persists can any person guide me?
Changed Iframe code as show below after creating new pipe:
<iframe src="http://localhost:8087/bim/api/v1/dashboardTree/{{companyId}} |safe"></iframe>
The code of the pipe:
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
@Pipe({
name: 'tree'
})
export class TreePipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) {}
transform(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
node.js angular angular6
node.js angular angular6
New contributor
New contributor
edited yesterday
Tân Nguyễn
3,48932350
3,48932350
New contributor
asked yesterday
Garg Jigasu
13
13
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
src
attribute is a string, a pipe isn't evaluated there. In order for it to be evaluated as an expression, it should be:
<iframe [src]="('http://localhost:8087/bim/api/v1/dashboardTree/' + companyId) | safe"></iframe>
Also, there's an inconsistency, the pipe is safe
in one place and tree
in another.
thank you for your reply issue is fixed thanks.
– Garg Jigasu
yesterday
You're welcome. Consider marking the answer as accepted if it solves the problem.
– estus
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
src
attribute is a string, a pipe isn't evaluated there. In order for it to be evaluated as an expression, it should be:
<iframe [src]="('http://localhost:8087/bim/api/v1/dashboardTree/' + companyId) | safe"></iframe>
Also, there's an inconsistency, the pipe is safe
in one place and tree
in another.
thank you for your reply issue is fixed thanks.
– Garg Jigasu
yesterday
You're welcome. Consider marking the answer as accepted if it solves the problem.
– estus
yesterday
add a comment |
up vote
0
down vote
src
attribute is a string, a pipe isn't evaluated there. In order for it to be evaluated as an expression, it should be:
<iframe [src]="('http://localhost:8087/bim/api/v1/dashboardTree/' + companyId) | safe"></iframe>
Also, there's an inconsistency, the pipe is safe
in one place and tree
in another.
thank you for your reply issue is fixed thanks.
– Garg Jigasu
yesterday
You're welcome. Consider marking the answer as accepted if it solves the problem.
– estus
yesterday
add a comment |
up vote
0
down vote
up vote
0
down vote
src
attribute is a string, a pipe isn't evaluated there. In order for it to be evaluated as an expression, it should be:
<iframe [src]="('http://localhost:8087/bim/api/v1/dashboardTree/' + companyId) | safe"></iframe>
Also, there's an inconsistency, the pipe is safe
in one place and tree
in another.
src
attribute is a string, a pipe isn't evaluated there. In order for it to be evaluated as an expression, it should be:
<iframe [src]="('http://localhost:8087/bim/api/v1/dashboardTree/' + companyId) | safe"></iframe>
Also, there's an inconsistency, the pipe is safe
in one place and tree
in another.
answered yesterday
estus
62.9k2193200
62.9k2193200
thank you for your reply issue is fixed thanks.
– Garg Jigasu
yesterday
You're welcome. Consider marking the answer as accepted if it solves the problem.
– estus
yesterday
add a comment |
thank you for your reply issue is fixed thanks.
– Garg Jigasu
yesterday
You're welcome. Consider marking the answer as accepted if it solves the problem.
– estus
yesterday
thank you for your reply issue is fixed thanks.
– Garg Jigasu
yesterday
thank you for your reply issue is fixed thanks.
– Garg Jigasu
yesterday
You're welcome. Consider marking the answer as accepted if it solves the problem.
– estus
yesterday
You're welcome. Consider marking the answer as accepted if it solves the problem.
– estus
yesterday
add a comment |
Garg Jigasu is a new contributor. Be nice, and check out our Code of Conduct.
Garg Jigasu is a new contributor. Be nice, and check out our Code of Conduct.
Garg Jigasu is a new contributor. Be nice, and check out our Code of Conduct.
Garg Jigasu is a new contributor. Be nice, and check out our Code of Conduct.
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%2f53349265%2funsafe-value-used-in-a-resource-url-context%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