1
I updated my Ionic from version 2 to version 3, and some plugins like 'Loadingcontroller' and "Platform" stopped working, generating the error Cannot find name 'Loadingcontroller'.
I couldn’t find in the doc how to import them now.
Follows my code:
import { LoadingController, Platform } from 'ionic-angular'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
providers: [ ProfileService, AlertService ]
})
export class AppComponent {
constructor(private router: Router,
public loadingCtrl: LoadingController,
private activatedRoute: ActivatedRoute,
private loginService: LoginService,
private profileService: ProfileService,
private _alertService: AlertService,
private platform: Platform ) {
router.events.subscribe((data) => {
this.path = data.url.substr(1);
})
this.getUserName();
this.platform.ready().then(() => {
this.platform.registerBackButtonAction(() => {
history.go(-1)
});
});
}}