Spring Boot/Angular app. routing a completely self contained HTML file

Kieran Wild

This might seem strange but I basically want to create a HTML file that is not in anyway associated to the angular/spring boot app.

Currently:

  • 'localhost:8080/' --- (redirects to angular app at '/#!/login')

What I want:

  • 'localhost:8080/angular' --- (redirects to angular app at '/#!/login')

  • 'localhost:8080/' --- (shows me a normal self contained HTML file e.g.'test.html')

I am very new to angular and Spring so even just guiding me in the right direction would be a huge help.

Thanks.

Can G.

You should use ngRoute.By the courtesy of "ngRoute" you can redirect user to specific views by the specific urls. Pls make some research about it. Let's assume you solve your view and redirect issues. How you gonna fetch data from server side? At this time I suggest you to look at service and factory objects. Hope it helps.

Sample code :

// create the module and name it exApp
// also include ngRoute for all our routing needs

var exApp= angular.module('exApp', ['ngRoute']);

// configure our routes
exApp.config(function($routeProvider) {
    $routeProvider

        // route for the home page
        .when('/', {
            templateUrl : 'pages/home.html',
            controller  : 'mainController'
        })

        // route for the about page
        .when('/about', {
            templateUrl : 'pages/about.html',
            controller  : 'aboutController'
        })

        // route for the contact page
        .when('/contact', {
            templateUrl : 'pages/contact.html',
            controller  : 'contactController'
        });
});

// create the controller and inject Angular's $scope
exApp.controller('mainController', function($scope) {
    // create a message to display in our view
    $scope.message = 'Everyone come and see how good I look!';
});

exApp.controller('aboutController', function($scope) {
    $scope.message = 'Look! I am an about page.';
});

exApp.controller('contactController', function($scope) {
    $scope.message = 'Contact us! JK. This is just a demo.';
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

completely self-contained virtual environment

From Dev

Creating a self contained, offline HTML5 app and the best method for embedding its resources

From Dev

Creating a self contained, offline HTML5 app and the best method for embedding its resources

From Dev

Trouble building self contained .NetCore App

From Dev

Fully self-contained HTML files with Pandoc

From Dev

Self contained login using HTML and/or Javascript

From Dev

Fully self-contained HTML files with Pandoc

From Dev

Self contained login using HTML and/or Javascript

From Dev

A web crawler in a self-contained python file

From Dev

Self contained publish ASP.NET Core 2.0 app to Azure

From Dev

Show HTML file contained within the extension

From Dev

Self Contained WPF .net

From Dev

Spring MVC routing in Google App Engine

From Dev

Angular 2 - Routing Issues with file based app

From Dev

Html5 routing with Spring and Angular

From Dev

Html5 routing with Spring and Angular

From Dev

Any way to deploy a Meteor web app as a standalone self-contained package?

From Dev

Qt Mac Application Failed to Create Self-contained App Bundle (Qt Creator Build)

From Dev

Issue with nested DLL referencing in a self-contained .Net Core web app running as a Windows service

From Dev

Is it possible to create a self contained Angularjs app that will not clash with with any other Js or css libraries on the same page

From Dev

Visual Studio 2017 ASP.Net Publish Self-Contained Dot Net Core App

From Dev

How to specify the target runtimes for a self-contained cross-platform .NET Core app?

From Dev

Why does my Spring Boot web app not run completely in Gradle?

From Dev

Mimic R CMD build HTML vignette: Embed external images as self contained

From Dev

rails: routing to a html file in the root directory

From Dev

rails: routing to a html file in the root directory

From Dev

Angular Partials: templateUrl Routing Local .HTML File

From Dev

Self-contained generic memento

From Dev

Self-contained shared library

Related Related

  1. 1

    completely self-contained virtual environment

  2. 2

    Creating a self contained, offline HTML5 app and the best method for embedding its resources

  3. 3

    Creating a self contained, offline HTML5 app and the best method for embedding its resources

  4. 4

    Trouble building self contained .NetCore App

  5. 5

    Fully self-contained HTML files with Pandoc

  6. 6

    Self contained login using HTML and/or Javascript

  7. 7

    Fully self-contained HTML files with Pandoc

  8. 8

    Self contained login using HTML and/or Javascript

  9. 9

    A web crawler in a self-contained python file

  10. 10

    Self contained publish ASP.NET Core 2.0 app to Azure

  11. 11

    Show HTML file contained within the extension

  12. 12

    Self Contained WPF .net

  13. 13

    Spring MVC routing in Google App Engine

  14. 14

    Angular 2 - Routing Issues with file based app

  15. 15

    Html5 routing with Spring and Angular

  16. 16

    Html5 routing with Spring and Angular

  17. 17

    Any way to deploy a Meteor web app as a standalone self-contained package?

  18. 18

    Qt Mac Application Failed to Create Self-contained App Bundle (Qt Creator Build)

  19. 19

    Issue with nested DLL referencing in a self-contained .Net Core web app running as a Windows service

  20. 20

    Is it possible to create a self contained Angularjs app that will not clash with with any other Js or css libraries on the same page

  21. 21

    Visual Studio 2017 ASP.Net Publish Self-Contained Dot Net Core App

  22. 22

    How to specify the target runtimes for a self-contained cross-platform .NET Core app?

  23. 23

    Why does my Spring Boot web app not run completely in Gradle?

  24. 24

    Mimic R CMD build HTML vignette: Embed external images as self contained

  25. 25

    rails: routing to a html file in the root directory

  26. 26

    rails: routing to a html file in the root directory

  27. 27

    Angular Partials: templateUrl Routing Local .HTML File

  28. 28

    Self-contained generic memento

  29. 29

    Self-contained shared library

HotTag

Archive