0

New to Angular. Trying to define page title inside the page class and display it in the nav menu.

  1. Created project using "ionic start myApp sidemenu --v2"
  2. Modified myApp/app/pages/page1/page1.ts enter image description here

  3. Modified myApp/app/app.html enter image description here

  4. ionic serve

Menu entries are blank. enter image description here

Tried console logging Page1.title from myApp/app/app.ts, but Sublime Text shows:

ERROR: Property 'title' does not exist on type 'typeof Page1'

How can I access page class properties from the main app class?


  • If the question is not related to AngularJS (1.x) then please remove the angularjs tag. - Günter Zöchbauer
  • Try to set title as static property. - Lyubimov Roman
  • @FriOne - That was it, so simple. Thanks. - WeaponX86
  • There seems to be a catch with this. Setting the property to static makes it inaccessible from the template. Any way around that? - WeaponX86

Related

Latest