Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect AngularJS 2 to a REST-API?

this is a new field of programming for myself, because I just wrote little programmes in java so far. In the last few days I tryed to start a new, "bigger" project. Until now I got a:

  • running jetty console with a servlet --> should be the rest-api
  • running angularJS 2 project and added some polymer-components

My problem is to get the variable data inside the polymer elements. It doesn't matter if i got them about polymer data binding or about javascript and the rest api..But i don't know how to do it..

Is there anyone, who understands me and could give me some tips or a link to a useful tutorial? By interest I can present my code, too.

Thanks, Michael

like image 480
Michi Avatar asked Nov 08 '22 19:11

Michi


1 Answers

AngularJS and Polymer are competing technologies that are unlikely to work together and certainly should not be used together.

In particular, they offer different data binding approaches that won't work together. This is true for every JS data binding technology.

Polymer offers some good getting started.

like image 87
Scott Boring Avatar answered Nov 15 '22 06:11

Scott Boring