Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Generated code does not do what was intended #182

Closed
mchapman opened this issue Oct 17, 2016 · 1 comment
Closed

Generated code does not do what was intended #182

mchapman opened this issue Oct 17, 2016 · 1 comment

Comments

@mchapman
Copy link

Short description of the problem:

My source code:

  private gotoHomepage(data: any): void {
    console.log('gotoHomepage!');
    let test:number = 0;
    let activePage: ViewController = this.nav.getActive();
    if (!activePage || activePage.component['name'] === 'LoginPage') {
      test = 1;
      this.nav.setRoot(HomePage, data);
    }
    console.log('Test is now ', test)
  }

takes me to my home page and outputs 1 when I run ionic serve

When I run ionic run android I get the output 0 from the generated code:

        t.prototype.gotoHomepage = function(t) {
            console.log("gotoHomepage!");
            var e = 0
              , n = this.nav.getActive();
            n && "LoginPage" !== n.component.name || (e = 1,
            this.nav.setRoot(Ltt, t)),
            console.log("Test is now ", e)
        }

Which @ionic/app-scripts version are you using?
0.0.23

Cordova CLI: 6.3.1
Gulp version: CLI version 1.2.2
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS
Node Version: v6.7.0

@mchapman
Copy link
Author

Ooops - this is to do with name mangling, not incorrect code generation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant