This code above works for me, but the view does not open on every click, My code is like this view.ts page
import {DomSanitizationService} from '@angular/platform-browser'; import { NavController, NavParams } from 'ionic-angular'; import { Component, OnInit } from '@angular/core'; import {GetPageService} from "./get_page.service"; import { Http } from '@angular/http'; @Component({ templateUrl: 'build/pages/view/view.html', providers: [GetPageService] }) export class ViewPage {
Next, my service get_page.servise.js page-
import { NavController, NavParams } from 'ionic-angular'; import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import { Observable } from "rxjs/Rx"; import { ViewPage } from '../view/view'; @Injectable() export class GetPageService { private url; private retryCount = 0;
- view this page
<iframe class= "webPage" [src]='page' width="100%" height="250" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>
There is only one problem: my view loads with every alternative click. How to solve it
source share