What I'm currently trying to do is to have an Angular 7 application nested inside an Angular 1.x one. I've created it inside my main AngularJs app, served it using express and opened it via a link in my main application.
Unfortunately, I don't get session data in this nested app, so every call to my API fails, do you know any way I can pass this kind of information between two Angular apps? Is this a viable solution?
Related
I am trying to upgrade a large Enterprise application from AngularJS v1.4 to Angular 8 and trying to look for various approaches for the same.
Since we are on angularJS1.4, we cannnot use ngUpgrade Module provided by Angular team because in order to do so we need to first migrate AngularJS to version 1.6+ and controllers to components. (Hence, this approach is discarded).
A complete rewrite of the application in Angular 8.
I read about single spa where two frameworks can coexist together.
Using an iframe to load angularjs in angular app and then gradually re-write the new code in angular.
Create a completely different application in Angular, then from my AngularJS navigate to new Angular application as per route. Both the apps will run on different ports locally, but will run on same domain on server hence sharing the cookies and localstorage.
We are thinking of going with approach 5.
Which of the following approach should I go with or is there any other approach I can go?
Any other inputs will be appreciated.
Currently I have an application built with Angular 2 (all the front-end side) and Symfony 3 (web framework) . I have defined each view as an Angular application.
I think it's the time to migrate to a Single App but I have some questions before I venture into the lion's den.
If a user change manually the URL, of course, they, should enter to the requested URL, but how can angular know which url is trying to open?
I should create multiple controllers or only one that catch all the requests?
If none of above are the right way, please, can you suggest any way to do it?
Thank you so much.
If you're trying to build a Single Page application, it means that your routes will be managed by your front-end, here by Angular 2 via #angular/router.
Symfony can then be only used as a back-end web service (i.e. a Restful API) that will answer to your front-end calls via JSON responses. Depending on the size of your API, you may wish to use FOSRestBundle for that purpose.
So you don't have to worry about Symfony routing interpretation since your urls will be managed by Angular router. Symfony routes will be called directly by your Angular application to get/post/put/delete/patch your back-end data.
UPDATE
To answer you comment, a user who directly enters a URL will simply see the page you linked to this url via Angular routing, there is (almost) no difference between front-end and back-end routing.
If you want to dive deeply in how hash routing works in javascript, you can check this article.
To see a real-life example of a SPA with full Angular routing, ga.me is a good start.
I'm working on a project where all may work is jsp pages can i add AngularJS inside these pages , i'm also new to Angular
I work on a web project, which renders a lot of graphs and animation charts to end users. We have been using the AngularJS in the jsp for some time and this works fine for us. With jsp, one can easily determine the request context (for e.g the request context URI for another link) on the webpage. With AngularJS, we develop the json returning services on server side and process the data via angularJS directives.
I have a standalone Angular JS Application that displays a table of data. I want to load thisapp on request in multiple places in my existing non AngularJS web site. All the angular app needs to initialise is a userguid that I have in the page when I need to load the app, my problem is how to pass this into the angular app at load.
I have tried using "bootstrap(document, ['myApp'])" but cannot se a way to pass the variable in, ideally I could do this bootstrap(document, ['myApp'], variablehere);
I can make the app load by adding the userguid variable to window and receiving it from there but this seems horrible and tied to the app.
Any help appreciated
Thanks
How can i add multi web part sharepoint which used angularjs module?
I have web part in which i have used angular the problem is when i want to add this web part for several times in a page i don't know how to separate angular modules name? when there is only one web part added in the page it works properly but when there are more than one problem start
i guess i should create dynamic names for modules in server side am i right? is there any other way?
I used angular.bootstrap.
This resource helped me to figure out how to load different angularjs html+js files in 2 different content editor webparts. I also made sure to load angularjs only once on the page.