Embed yeoman created angularjs application in play framework - angularjs

My target software architecture:
Backend-application (RESTful http API, responding JSON)
Play Framework (v2.3.8)
Frontend-application (requests the backend-application and renders the result)
AngularJS App
Yeoman scaffolded (angular-generator)
My question:
I want to host the angularjs inside the play application. How can I
achieve that?
(I don't want to create a second app and host it with grunt serve since this causes problems because of the 'same origin policy')

You could use Play Yeoman. Here is a small example application which shows a simple implementation.

Related

Is it possible to run angular js app directly on mobile

i just want to know that is it possible to run angularjs app on mobile directly means without using web browser??
I search google and it seems i can't but my client want to do that.
you could also use Ionic Framework (ionicframework.com) for this as it is heavily using Angular and encapsulating everything in real mobile apps that are capable of being deployed via App Stores (Play Store, iTunes, ...).
Best regards,
Steviee
You can use Cordova Framework Which generates mobile application in android and ios also for that you can refer -https://cordova.apache.org/docs/en/latest/
Follow this documentation step and you get all files with proper structure in that you can write your application code.
Try angular bundler for cordova.
abc framework - https://github.com/thruthesky/abcframework which gives you a great convenient building mobile apps using Angular.
abc is Angular Bundler for Cordova which helps you building mobile apps with Angular.

Fetch facebook post in Angularjs application

I am new to angularjs. I would like to fetch my facebook post in Angularjs application.
Kindly advice me how to start up this process through Angularjs.
Thanks in advance!
Please start exploring all Facebook API's for authorizing in different domain.Below is the Facebook API document which might help you to understand on how to get authorized to use FB API's
https://developers.facebook.com/docs/javascript
https://developers.facebook.com/docs/javascript/howto/angularjs - it will create a setup like plugins inside your app after you include it in your angularjs app.
For AngularJs app please create a angular scaffolding templates using Yoeman
generator for project setup - cmd - 'yo angular' will help you to
create angularjs application.
To run your application locally / to create proxies/ to build and zip use -
GruntJS
To check your dependencies for your project use bower/npm
Basically you need angular, angular-route, angular-resources as your
dependency to your application.
Start exploring about angular route,angular module,controllers,services,directives in angularjs website.

Technologies to create a hybrid application in Cordova

This is not a programming question. If it is not appropriate to post it here, just advise me some place worth to share this.
What would be best to know in order to startup a project in Cordova. What i need to know is that in order to create a working web and android app what should i use?
So far
I use Cordova.
Ionic for GUI.
PHP and MySQL for back end
Angular JS for client side and controller for the app.
JSON
Do I have to use AJAX as well? if so, where would it fit?
"Do I have to use AJAX as well? if so, where would it fit?"
Yes, you should build a Single Page Application inside Cordova using any framework that you desire. Ionic/Angular is a valid choice here, other options include JQuery/Bootstrap, React JS, Framework7, OnsenUI and pretty much any combination of JS single page application framework and mobile focussed web front end framework that you like and can make work together.
For going beyond what the web view can do you'll use off the shelf plugins, or write your own which will need Java / Objective-C / C# or Swift skills depending on which platforms you're using.
As you want to be building a single page application you will need to make AJAX calls to get resources from servers, call APIs and the like. Do this using the mechanism built into your chosen framework, e.g. $http service with Angular, $.ajax for JQuery etc.
With angular you can use AngularJS $http
Link to Angular documentation: https://docs.angularjs.org/api/ng/service/$http

Create a mobile webapp with Angular

I'm currently learning Angular JS and plan on creating a website using RESTFul to communicate with the server (which will be in Node.js).
I would like to know how to proceed to "convert" this website into a mobile app.
I saw tools like Apache Cordova but I have no mobile developing experience so I don't really know how all of this works.
I saw other tools like Ionic and ngCordova (created by Ionic) but I don't get the point, Angular is just a JS script to insert in my HTML page right ?
So why would I need something like Ionic ? Isn't Apache Cordova enough ?
Ionic is a webframework that makes use of apache cordova in the back.
Cordova is used for mobile app programming in javascript and will compile your javascript code to native code for android, iOS, ...
AngularJS is used for making development of Single Page Web Applications more delightful by offering many nice code features for programming MVC apps.
Ionic now at the end, puts it all together by offering you user interface components that will look native on all mobile devices + the browser. And on top offers you angular js modules that make working with webapps easier (e.g. navigationHistory ...)
If you start new and want to create a nifty mobile application, I would start with ionic. It comes with a lot of css or sass that makes it feel / look native and of course you can change everything to your needs. To access phone features (e.g. location, camera ...) cordova steps in. I suggest doing this guide, that will take you through your first ionic app.

Fast way to develop AngularJS in a Java environment

I am currently working on a Java based Maven project that has a REST backend module and using angular JS as a frontend that uses the backend for data. The 2 modules are named "rest" and "web" accordingly and are deployed as 2 separate war files to a glassfish instance during development. The glassfish is on a different machine.
My problem is that this is kind of slow, especially when developing the angular based frontend. Fix a minor spelling mistake, package, redeploy. Not that slow but every character change or fiddling with angular is another 20-30 seconds lost.
One thing I tried is to directly load the files from the source directory into the browser with file:// tag. This is OK as long as it tries to call the REST backend which fails due to CORS (I don't remember the exact error message, it just doesn't work). This happens a lot so it's a no-go.
I'm open to every kind of solution to develop angular in a way that I could see my changes instantly instead of deploying it every time? Much like the guy does in the egghead videos.
I would recommend breaking your Angular JS application into its own separate project, this would be a new HTML5 project on Netbeans. That way you can focus on pure backend and frontend development in their respective projects and you do not have to manually separate the war files. This link will help you to get CORS working if you are defining your RESTFUL services with Jersey Access-Control-Allow-Origin in ajax call to jersey rest web services. Or you can just mock the data out in the front end project.

Resources