2

I want to remove all data-ng-include tags from my AngulaJS App. I found some answers but none satisfies what I want to do.

I am moving away from AngularJS, and I want to somewhat componentize the views, in order to move to React. For that, I would like to remove data-ng-include but retain their properties.

Example:

<div data-ng-include="'menuBar.html'"></div>

How do I include the menuBar HTML file in another in AngularJS, without ng-include?

I know, there are questions similar to this, but no definitive answer. If you know of a way, it would be awesome, thank you.

Dimitris Efst
  • 1,690
  • 2
  • 23
  • 49
  • How about Directive? https://docs.angularjs.org/guide/directive – holydragon Nov 26 '18 at 10:23
  • No, as i said I want to get away from Angular. It is not the easiest think, but I just cleaned a whole bunch of them, and ported the functionality to Redux so no. Thanks though.. – Dimitris Efst Nov 26 '18 at 10:25
  • So, I was just prompted by a friend to an Article, that suggest using components instead. My main gripe with it, is that AngularJS components, are dumb components. Would it be able to do it with using something like `` ??? – Dimitris Efst Nov 26 '18 at 10:29
  • That is Directive. – holydragon Nov 26 '18 at 10:31
  • Hhhmm. I must be understanding something wrong about AngularJS then. I thought component and directive are 2 different terms. I will look into it.. – Dimitris Efst Nov 26 '18 at 10:34
  • 1
    Apart from those AngularJS things, see https://www.w3schools.com/howto/howto_html_include.asp and https://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file. – holydragon Nov 26 '18 at 10:36
  • Component is simply an AngularJS directive with some default settings – Pop-A-Stash Nov 26 '18 at 15:20

0 Answers0