diff --git a/src/core/directives/format-text.ts b/src/core/directives/format-text.ts index 4d8f34b0d..eea0da0df 100644 --- a/src/core/directives/format-text.ts +++ b/src/core/directives/format-text.ts @@ -27,7 +27,6 @@ import { Inject, ChangeDetectorRef, } from '@angular/core'; -import { IonContent } from '@ionic/angular'; import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; @@ -104,7 +103,6 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec constructor( element: ElementRef, - @Optional() protected content: IonContent, protected viewContainerRef: ViewContainerRef, @Optional() @Inject(CORE_REFRESH_CONTEXT) protected refreshContext?: CoreRefreshContext, ) { @@ -503,8 +501,8 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec return; } - // Angular 2 doesn't let adding directives dynamically. Create the CoreLinkDirective manually. - const linkDir = new CoreLinkDirective(new ElementRef(anchor), this.content); + // Angular doesn't let adding directives dynamically. Create the CoreLinkDirective manually. + const linkDir = new CoreLinkDirective(new ElementRef(anchor)); linkDir.capture = this.captureLinks ?? true; linkDir.inApp = this.openLinksInApp; linkDir.ngOnInit(); diff --git a/src/core/directives/link.ts b/src/core/directives/link.ts index 0c7e72553..e3d1f3971 100644 --- a/src/core/directives/link.ts +++ b/src/core/directives/link.ts @@ -12,9 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Directive, Input, OnInit, ElementRef, Optional, SecurityContext } from '@angular/core'; +import { Directive, Input, OnInit, ElementRef, SecurityContext } from '@angular/core'; import { SafeUrl } from '@angular/platform-browser'; -import { IonContent } from '@ionic/angular'; import { CoreFileHelper } from '@services/file-helper'; import { CoreSites } from '@services/sites'; @@ -47,7 +46,6 @@ export class CoreLinkDirective implements OnInit { constructor( element: ElementRef, - @Optional() protected content: IonContent, ) { this.element = element.nativeElement; }