MenuComponentActionExpander

Expands:

$applicationRoot.directory$/native/ionic/src/app/components/menu/menu.component.ts

if:

true
property value
element type ApplicationInstance
qualified name net.democritus.expander.ionic.applicationinstance.component.MenuComponentActionExpander
layer ROOT
technology COMMON
sourceType JS
phase expansion
features  

Example

Some example of the content generated by the expander:

import { Component, OnInit } from '@angular/core';
import { Router, RouterEvent } from '@angular/router';
import { MenuController } from '@ionic/angular';
import { AuthenticationService } from '../../services/authentication.service';

// anchor:custom-imports:start
// anchor:custom-imports:end

@Component({
  selector: 'app-menu',
  templateUrl: 'menu.component.html',
  styleUrls: ['menu.component.scss']
})
export class MenuComponent implements OnInit {

  activeRoute: string;
  // anchor:custom-attributes:start
  // anchor:custom-attributes:end

  constructor(
    private router: Router,
    private menu: MenuController,
    private authenticationService: AuthenticationService,
    // anchor:custom-constructor-fields:start
    // anchor:custom-constructor-fields:end
  ) {}

  ngOnInit() {
    this.router.events.subscribe((event: RouterEvent) => {
      this.activeRoute = event.url;
    });
    // anchor:custom-init-methods:start
    // anchor:custom-init-methods:end
  }

  ionViewWillEnter() {
    this.router.events.subscribe((event: RouterEvent) => {
      this.activeRoute = event.url;
    });
  }

  openApplicationRootHomePage() {
    this.router.navigate(['/home']);
    this.menu.close();
  }

  logout() {
    this.authenticationService.logout();
    this.menu.close();
    this.router.navigate(['/login']);
  }

  // anchor:custom-methods:start
  // anchor:custom-methods:end
}