I'm currently working on an application using AngularJS, now the thing is, I need to pass an URL when I click on a menu button so I can use that URL in an iframe on in another view with another controller. I've been trying a lot of things and ran through like whole Stackoverflow, but I couldn't find a solution for my problem..
My service:
module Services {
export class PassUrlService {
getUrl;
setUrl;
givenUrl;
constructor($scope) {
this.getUrl = function() {
return this.givenUrl;
}
this.setUrl = function (value: string) {
this.givenUrl = value;
}
}
}
}
My controller:
module Controllers {
export class MainController {
data = [];
sce;
IframeUrl;
constructor($scope, $sce) {
$scope.data = this.data;
$scope.vm = this;
this.sce = $sce;
}
setIframeUrl = function (url) {
this.IframeUrl = Services.PassUrlService.setUrl(this.sce.trustAsResourceUrl(url));
debugger;
}
}
}
The error I'm getting is:
error TS2339: Property 'setUrl' does not exist on type 'typeof PassUrlService'.
I hope someone can help me solving this problem, thanks in advance!