[AngularJS] Re: deploying an angular 2 app

2016-09-15 Thread Richard Perfect

On Thursday, September 15, 2016 at 9:00:06 PM UTC+12, norricorp wrote:
>
> Hi,
> new to angular. I was wondering how to deploy an angular app to a web 
> server? Is there documentation on this.
> I have experience with Java and Tomcat applications but not sure how it 
> works where all of the logic is in the front end.
> Regards,
> John
>

Hi, I'm a Java developer too. There's lots of different ways to do this, 
but the key idea is that an Angular Application is just a bunch of static 
web resource files. From the Java Application Server's point of view 
there's nothing really different Angular Html and JS files than there is 
from any other gif, png, or css file that you might have already been used 
to deploying. Since all of the HTML generation is taken out of the Java 
Application server it just presents REST Services to the Angular App.

You can try and merge Angular 2 code into you main Java application project 
but I find it's easier to keep them separate. Use a technology like 
Angular-CLI to build and develop the Angular App and have the Angular CLI 
web server proxy your requests back to the Java application server. When 
you're ready to deploy into a proper dev/test environment you can either 
keep the Angular stuff separate under it's own web server eg Ngnix/Apache 
or you can merge in the compiled Angular code into you WAR file.


-- 
The information contained in this email is privileged and confidential and 
intended for the addressee only. If you are not the intended recipient, 
please respect that confidentiality and do not disclose, copy or make use 
of its contents. If received in error, please destroy this email and 
contact the sender immediately. Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Angular 2 authentication?

2016-09-14 Thread Richard Perfect

>
>
> is there any tutorial on authentication angular 2?
> the angular 2 has native authentication?
>

The Docs from the main Angular site have a reasonable description of how to 
do "front-end" part of Authentication. In the section on Routing & 
Navigation look down about halfway for where it starts talking about Route 
Guards. A "Guard" is something that controls access to a route. Basically 
the idea is that the Guard prevents all access to the "protected" routes 
until the user has authenticated. 

It only talks about the browser side of things. You'll need to know how to 
do the back-end or find out how based on your particular back-end stack 
(Java, Python, .net etc..)

I was able to follow this and get authentication working for my project. 
See the following link.

https://angular.io/docs/ts/latest/guide/router.html#!#guards 

-- 
The information contained in this email is privileged and confidential and 
intended for the addressee only. If you are not the intended recipient, 
please respect that confidentiality and do not disclose, copy or make use 
of its contents. If received in error, please destroy this email and 
contact the sender immediately. Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.