Angular2 RouterLink not working in AppBuilder

2 posts, 0 answers
  1. Enterprise
    Enterprise avatar
    1 posts
    Member since:
    Feb 2016

    Posted 13 Jun Link to this post

    I am running an Angular2 app with routing, using the routerLink.
    The code below works great in the browser.

    @Component({
      selector: 'my-app',
      directives: [ROUTER_DIRECTIVES]
      template: `
        <div class="app">
          Hello world!
          <nav>
            <ul>
              <li>
                <a [routerLink]=" ['Home'] ">Home</a>
              </li>
              <li>
                <a [routerLink]=" ['Login'] ">Login</a>
              </li>
            </ul>
          </nav>
          <main>
            <router-outlet></router-outlet>
          </main>
        </div>
      `
    })

    However, when I run the same code on the Telerik AppBuilder platform for Android, it fails.
    It appears that the router link is resolving to something like: "file:///views/login.html"

    However, it appears that AppBuilder is expecting a path something more like: 
    file:///data/data/com.telerik.Animegination/files/12590FAA-5EDD-4B12-856D-F52A0A1599F2/views/login.html
    I say this because that is what the path for my index.html file looks like.

    Is the Angular2 routerLink not supporeted in Telerik AppBuilder?
    How do I get this to work?

     

  2. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 16 Jun Link to this post

    Hello Enterprise,

    Angular 2 support hasn't been introduced in AppBuilder, yet. However, if you are interested in such a concept, NativeScript offers Angular 2 support and you can take a look at this step by step tutorial for building a native mobile app using NativeScript and Angular 2:
    Building Apps with NativeScript and Angular 2

    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top