Importing 'Loadingcontroller' into Ionic 3

Asked

Viewed 99 times

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)
     });
  });  
}}

1 answer

1


The imports continue in the same way, but I believe it is necessary for you to update these libraries as well. Take a look at your package.json and check their version.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.