Coder Social home page Coder Social logo

kito99 / angular-primeng-jsweet-todo-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cincheo/jsweet-angular2-quickstart

2.0 2.0 4.0 1.11 MB

JSweet-enabled Angular 2 quickstart

License: MIT License

TypeScript 0.93% HTML 9.00% JavaScript 57.10% Java 25.37% CSS 7.60%

angular-primeng-jsweet-todo-client's Introduction

Example Todo app built with Angular 2, PrimeNG, and Java (using JSweet on the front-end and JAX-RS on the back-end)

This is part of the sample application for the presentation "Full Stack Java with JSweet, Angular 2, PrimeNG, and JAX-RS", originally given at JavaOne in September, 2016 by Kito D. Mann from Virtua, Inc.. It demonstrates how you can write an Angular 2 application with PrimeNG components using Java (courtesy of the JSweet transpiler), and have it talk to a standard Java back-end using JAX-RS.

This repository contains the front-end code; the back-end and slides are in separate repositories.

This project was forked from the Angular 2 Quickstart with Java; see that project for a simpler example without a back-end. There is also a JSweet PrimeNG Quickstart project available without a back-end.

Special thanks to Renaud Pawlak (JSweet lead developer) for his extensive assistance with getting this project working!

NOTE: This project uses the Angular 2.0RC5 and PrimeNG 1.0.0-beta.14 JSweet candies. In order to upgrade to newer versions, those candies must be manually upgraded. If you do that, please create a pull request!

Prerequisites

Node.js > v4.x.x and npm > v3.x.x.

Verify that you are running at least node v4.x.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors.

Maven (for compiling with JSweet).

Getting started

Clone the project.

git clone  https://github.com/cincheo/jsweet-Angular 2-quickstart my-proj
cd my-proj

Compile JSweet sources (located in: src/main/java).

mvn generate-sources

Note: you can also use Eclipse to compile (see the JSweet Eclipse plugin).

Install the npm packages described in the package.json and verify that it works:

Attention Windows Developers: You must run all of these commands in administrator mode.

npm install
npm start

This will open the application in your browser. If you compile again the Java source files, the application will automatically reload. Shut it down manually with Ctrl-C.

NOTE: If you have problems compiling fileupload.d.ts, edit the file and replace all references to DomSanitize with DomSanitizationService. This appears to be a bug with the version of PrimeNG used in the project.

How to extend the application

You can add new classes in the app package (src/main/java). Please be aware that in JSweet, each package is a module. So, all the classes defined in a given package will belong to the same TypeScript/JavaScript module.

New templates should be placed in the app folder.

A minimal Angular 2 API is defined in the def.angular package (the def package in JSweet is by convention similar to a d.ts file in TypeScript: it holds external declarations). When extending the application, you will need to provide the API elements that you are using and that would be missing in the current definitions.

If you want to use external JavaSript libraries, check out JSweet candies rather than writing definitions manually. Here definitions have to be written manually for Angular 2 because the corresponding candy does not exist yet.

Setup the back-end

Visit the angular-primeng-jsweet-todo-server project and clone the Java-based back-end built using Jersey and JAX-RS. See the README for that repository for more information.

angular-primeng-jsweet-todo-client's People

Contributors

renaudpawlak avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.