This is a migrated thread and some comments may be shown as answers.

Angular2 RouterLink not working in AppBuilder

1 Answer 69 Views
Android Devices
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Enterprise
Top achievements
Rank 1
Enterprise asked on 13 Jun 2016, 04:32 PM

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?

 

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 16 Jun 2016, 03:01 PM
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.

 
Tags
Android Devices
Asked by
Enterprise
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or