I emulated my project IONIC 2 on android and it from ERRO

Asked

Viewed 43 times

0

I emulated my project IONIC 2 on android and got the white screen and appeared the following ERROR:

EXCEPTION: Error in ./MyApp class MyApp - inline template:16:2 caused by: Connection is not defined 

What can it be? Below is the code of my Myapp class

import { Component, ViewChild } from '@angular/core';
import { Nav, Platform } from 'ionic-angular';
import { StatusBar, Splashscreen } from 'ionic-native';
import { BrandsPage } from '../pages/brands/brands';
import { VitrinePage } from '../pages/vitrine/vitrine';
import { ClientPage } from '../pages/clients/clients';
import { LoginPage } from '../pages/login/login';
import { TabsPage } from '../pages/tabs/tabs';
import { FuncoesPage } from '../pages/funcoes/funcoes';
import { FotosConceituaisPage } from '../pages/fotos-conceituais/fotos-conceituais';
import { FotosCatalogoPage } from '../pages/fotos-catalogo/fotos-catalogo';
import { ComprarPage } from '../pages/comprar/comprar';
import { PedidosPage } from '../pages/pedidos/pedidos';
import { ProdutosPage } from '../pages/produtos/produtos';
import { ListaClientesPage } from '../pages/lista-clientes/lista-clientes';
import { NotificacoesPage } from '../pages/notificacoes/notificacoes';
import { AnaliseCreditoPage } from '../pages/analise-credito/analise-credito';
import { TransportadoraPage } from '../pages/transportadora/transportadora';
import { NovoClientePage } from '../pages/novo-cliente/novo-cliente';
import { EmailPage } from '../pages/email/email';
import { VideosEmpresaPage } from '../pages/videos-empresa/videos-empresa';
import { ConfiguracoesPage } from '../pages/configuracoes/configuracoes';
import { VideosTutoriaisPage } from '../pages/videos-tutoriais/videos-tutoriais';
import { DescontosPage } from '../pages/descontos/descontos';
import { TabelaPrecosPage } from '../pages/tabela-precos/tabela-precos';
import { DuvidasPage } from '../pages/duvidas/duvidas';
import { SuportePage } from '../pages/suporte/suporte';
import { RelatoriosPage } from '../pages/relatorios/relatorios';
import { ListaProdutos } from '../pages/lista-produtos/lista-produtos';
import { ModalInformacao } from '../pages/modal-informacao/modal-informacao';
import { ModalPreco } from '../pages/modal-preco/modal-preco';
import { SincronizacaoPage } from '../pages/sincronizacao/sincronizacao';
import { TranslateService } from 'ng2-translate/ng2-translate';

@Component({
  templateUrl: 'app.html',
  selector: 'app.component.scss'
})

export class MyApp {
  @ViewChild(Nav) nav: Nav;

  rootPage: any = LoginPage;

  pages: Array<{title: string, component: any}>;

  constructor(public platform: Platform) {
    this.initializeApp();

    // used for an example of ngFor and navigation
    this.pages = [
      {title: 'Vitrine', component: VitrinePage},
      {title: 'Clientes', component: ClientPage},
      {title: 'Tabs', component: TabsPage},
      {title: 'Funcoes', component: FuncoesPage},
      {title: 'Fotos Conceituais', component: FotosConceituaisPage},
      {title: 'Fotos do Catálogo', component: FotosCatalogoPage},
      {title: 'Comprar', component: ComprarPage},
    ];

  }

  initializeApp() {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.backgroundColorByHexString('#1ebb90');
      Splashscreen.hide();
    });
  }

  openPage(page) {
    // Reset the content nav to have just this page
    // we wouldn't want the back button to show in this scenario
    this.nav.setRoot(page.component);
  }
}

  • What is the 16:2 line? Do you ever check the connection? It seems that the error is in searching for a class with the name Connection and does not find.

  • line 16 is this: import { Notifications } from '.. /pages/notifications/notifications';

  • And within Notifications page, you can edit the question and put that file in it?

  • i did not understand the file that you’re talking about is the plugin Cordova? The plugin Cordova I put in the Ionic project, or on my device?

  • In my project I have not made any connection with bank or anything

  • I rushed to talk about Ordova. But tell me, I could edit and put the Notificationspage?

  • then the Notificationspage already exists and has been done correctly, which is strange

Show 2 more comments
No answers

Browser other questions tagged

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