title: Ionic Uncaught (in promise): invalid link
body: <p>I have probably a problem with <code>this.nav.push</code> in Ionic. I have done a login/registration page but when I login, I get this error message. I have to add some code in login.ts and e.g home.ts (which is the main page) ?</p>
  
  <blockquote>
    <p>Runtime Error <br>
    Uncaught (in promise): invalid link: HomePage</p>
  </blockquote>
  
  <hr>
  
  <blockquote>
    <p>Error: Uncaught (in promise): invalid link: HomePage
        at d (<a href="http://localhost:8100/build/polyfills.js:3:3991" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:3991</a>)
        at l (<a href="http://localhost:8100/build/polyfills.js:3:3244" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:3244</a>)
        at Object.reject (<a href="http://localhost:8100/build/polyfills.js:3:2600" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:2600</a>)
        at NavControllerBase._fireError (<a href="http://localhost:8100/build/main.js:45465:16" rel="nofollow noreferrer">http://localhost:8100/build/main.js:45465:16</a>)
        at NavControllerBase._failed (<a href="http://localhost:8100/build/main.js:45453:14" rel="nofollow noreferrer">http://localhost:8100/build/main.js:45453:14</a>)
        at <a href="http://localhost:8100/build/main.js:45508:59" rel="nofollow noreferrer">http://localhost:8100/build/main.js:45508:59</a>
        at t.invoke (<a href="http://localhost:8100/build/polyfills.js:3:11562" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:11562</a>)
        at Object.onInvoke (<a href="http://localhost:8100/build/main.js:4622:37" rel="nofollow noreferrer">http://localhost:8100/build/main.js:4622:37</a>)
        at t.invoke (<a href="http://localhost:8100/build/polyfills.js:3:11502" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:11502</a>)
        at n.run (<a href="http://localhost:8100/build/polyfills.js:3:6468" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:6468</a>)
        at <a href="http://localhost:8100/build/polyfills.js:3:3767" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:3767</a>
        at t.invokeTask (<a href="http://localhost:8100/build/polyfills.js:3:12256" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:12256</a>)
        at Object.onInvokeTask (<a href="http://localhost:8100/build/main.js:4613:37" rel="nofollow noreferrer">http://localhost:8100/build/main.js:4613:37</a>)
        at t.invokeTask (<a href="http://localhost:8100/build/polyfills.js:3:12177" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:12177</a>)
        at n.runTask (<a href="http://localhost:8100/build/polyfills.js:3:7153" rel="nofollow noreferrer">http://localhost:8100/build/polyfills.js:3:7153</a>)</p>
  </blockquote>
  
  <p>@edit: The problem occurs when I want login to my app. Here is the code to login.</p>
  
  <p>login.ts</p>
  
  <pre><code>public login() {
      this.showLoading()
      this.auth.login(this.registerCredentials).subscribe(allowed =&gt; {
        if (allowed) {        
         this.nav.push('HomePage');
        } else {
          this.showError("Access Denied");
        }
      },
        error =&gt; {
          this.showError(error);
        });
      }
  </code></pre>
  
  <hr>
  
  <p>auth-service.ts ( here is public function which executes my login and where I have password and email which I need to type in login ) </p>
  
  <pre><code>  public login(credentials) {
      if (credentials.email === null || credentials.password === null) {
        return Observable.throw("Please insert credentials");
      } else {
        return Observable.create(observer =&gt; {
          // At this point make a request to your backend to make a real check!
          let access = (credentials.password === "pass" &amp;&amp; credentials.email === "email");
          this.currentUser = new User('Simon', 'saimon@devdactic.com');
          observer.next(access);
          observer.complete();
        });
      }
    }
  </code></pre>
  
  <p>I don't know why this code is wrong. My home page in my app is home.ts and class is HomePage</p>