title: How to integrate service layer with database in Angular 2 web app and do packaging for deployment?
body: <p>I'm new Angular2 and learning it using TypeScript. I understood that everything is component in Angular2 and we do not render whole HTML page but by just specific component. I have 2 basic queries here:-</p>
  
  <p>1) In my sample, Angular 2 app, I have service component class which brings static data to my component class using Dependency Injection. Instead of static, I want to bring data from my database (MongoDB). Between service layer and database, I'm quite confused. May I know what are industry best approaches to integrate service layer and database layer in a regular Angular 2 app? Do we have tightly coupled architecture like normal JAVA J2EE MVC architecture from controller to service to dao to hibernate/JDBC/ibatis or do we integrate using web services (RESTful APIs'), loose-coupled fashion?</p>
  
  <p>2) Secondly, how do we package this Angular 2 web app? Do we simply zip it or export as WAR file? Currently, I'm running it on my local system using my Node.js (npm start, etc on command prompt) and using Visual Studio Code for coding? How to create WAR file and does Tomcat App server supports Angular 2 apps?</p>
  
  <p>Thank you</p>