Ng-include paths? or anything else

Hello, I am struggeling with ng-include.

I have a page with slider and ng-include. I have also a page called dummy on the same folder level. The dummy page only contains

This is a dummy.

dummy is not imported anywhere.

In the slider I will include the dummy.

sliderpage

Slide 1

<ion-slide style="background-color: blue">
  <h2>Slide 2</h2>
  <div ng-include="'../dummy/dummy.html'"></div>
</ion-slide>

<ion-slide style="background-color: red">
  <h2>Slide 3</h2>
  <div ng-include="'dummy/dummy.html'"></div>

</ion-slide>

<ion-slide>
  <h2>Slide 4</h2>
  <div>
    <mycustomcomponent></mycustomcomponent>
  </div>
</ion-slide>

My CustomComponent is working, but I can’t include a other ionic page. From the hierarchy level it should be slide2. Angularjs doc says put it in between double quote singe quote But what is wrong?

Next question is, if I have a html-page (not a ionic page) in the asset folder, how could I include that?
ionc 3.x

Thanks in advance, anna.

Okay ion-header and Slide 1 is not shown in the code above.

1 Like

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

AngularJS (Angular 1) is a completely different animal from the Angular used by the current version of Ionic. You can’t use Angular 1 directives (such as ng-include) in a modern Ionic app.

Assuming the next question is “what is the modern Angular equivalent of ng-include?”, the answer is “by design, there isn’t one, so you’re going to have to rethink the design here”.

1 Like

Thanks, rapropos for the great advice.

Oh man, thats hard. What a waste of time. I think a need new glasses, bevor I go hunting.

Best regards, anna.

1 Like