1

Is it possible to concatenate interpolated strings in the template? It doesn't look like I can combine string interpolation with more text when I want to visit a specific URL (in the data properties of the object tags below).

Example:

<mat-tab-group>
    <mat-tab label="{{ thing.FileName }}" *ngFor="let thing of things | async">

        <-- WORKS FINE -->
        <div id="pdf">
            <object width="100%" height="650" type="application/pdf" data="https://someurl.com%2FToward%20A%20Theory%20Of%20Schizophrenia%20-%20Gregory%20Bateson.pdf?alt=media&token=f68187e1-1e1b-4066-8a5d-a6f3f6576f72#zoom=85&scrollbar=0&toolbar=0&navpanes=0" id="pdf_content" style="pointer-events: none;">
                <p>Error message here, in case the PDF cannot be displayed.</p>
            </object>
        </div>


        <-- ERROR -->
        <div id="pdf">
            <object width="100%" height="650" type="application/pdf" data="{{submission.FileURL}}#zoom=85&scrollbar=0&toolbar=0&navpanes=0" id="pdf_content" style="pointer-events: none;">
                <p>Error message here, in case the PDF cannot be displayed.</p>
            </object>
        </div>


    </mat-tab>
  </mat-tab-group>

Typescript

thingsCollection: AngularFirestoreCollection<Submission>;
things: Observable<Submission[]>;

this.thingsCollection = this.afs.collection(pathSubmissions);
this.things = this.submissionsCollection.valueChanges();
FiringBlanks
  • 1,998
  • 4
  • 32
  • 48

0 Answers0