Blockquote
how to set the parameter in the URL?
My code as TS below
import { KlassaktUserService,KlassaktStorageService, KlassaktApiService } from '../../core';
import { KlassaktDashboardService, Student, listData } from '../../core/api/dashboard.sevice';
import { DomSanitizer, SafeResourceUrl, SafeUrl} from '@angular/platform-browser';
declare var $: any;
@Component({
selector: 'klassakt-photos',
templateUrl: './photos.component.html'
})
export class KlassaktPhotosComponent extends KlassaktDashboardComponent implements OnInit {
}
public loaderService: KlassaktLoaderService;
async ngOnInit() {
await super.ngOnInit();
}
public constructor(
protected _dashboardService: KlassaktDashboardService,
public _sanitizer: DomSanitizer) {
let selectedStudent = {
schoolId: "134"
}
this.src = this.sanitizer.bypassSecurityTrustResourceUrl(`http://designs.mydeievents.com/jq-3d-flip-book/index.html?id=${selectedStudent.schoolId}`)
}
}
public get students(): Student[]
{
return this._dashboardService.account.students;
}
}
this is my parameter which is found in the component.html file.
<p>Hi Arjun this is school Id {{selectedStudent.schoolId}}</p>
from ts file, I want to pass the same parameter 134 is my static school id
schoolId: "134"
if I want to set dynamic parameter the code is below but not getting "param"
param : number = this.selectedStudent.schoolId;
But i am not getting static or dynamic parameter in my project.
If I am using the below code working fine.
@Input()
url: string = "https://arjunwalmiki.blogspot.com/";
urlSafe: SafeResourceUrl;
this.urlSafe = this._sanitizer.bypassSecurityTrustResourceUrl(this.url);
<iframe width="200px" height="300px" frameBorder="0" [src]="urlSafe"></iframe>
above code is working because of its parameterless call with a parameter not working.