ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.09k stars 13.51k forks source link

Angular Live Cycles does not work on Ionic4 (@ionic/angular: 0.2.1) #14282

Closed mburger81 closed 6 years ago

mburger81 commented 6 years ago

Ionic version: (check one with "x") (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [ ] 3.x [x] 4.x

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request

Current behavior: Adding simply OnInit livecycle to HomePage component does not work, it seems no one of Angulars livecycles are called.

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-page-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage implements OnInit {

  constructor() {
    console.log('constructor');
  }

  ngOnInit() {
    console.log('ngOnInit');
  }
}

Expected behavior: I know Ionic has his own livecycles, but I hope this behavior is only a bug and nothing else

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/usr/lib/node_modules)
   @ionic/cli-utils  : 2.0.0-rc.2
   ionic (Ionic CLI) : 4.0.0-rc.2

local packages:
   @angular-devkit/core       : 0.3.2
   @angular-devkit/schematics : 0.3.2
   @angular/cli               : 1.7.3
   @ionic/core                : 0.2.1
   @ionic/schematics-angular  : 1.0.0-rc.1
   Ionic Framework            : @ionic/angular 0.2.1

System:
   NodeJS : v8.11.1
   npm    : 5.8.0
   OS     : Linux 4.13
mburger81 commented 6 years ago

This bug seems to be resolved in latest @ionic/angular 4.0.0-alpha.1, can someone confirm this too?

manucorporat commented 6 years ago

Yes! It should be fixed!

ionitron-bot[bot] commented 6 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.