Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Routing doesn't work in client-side-only apps #6603

@Randgalt

Description

@Randgalt

I'm writing a client-side-only app - i.e. the app runs completely on the client and is not hosted through a server. Angular routing assumes an http connection and tries to load views via http. This generates exceptions. You can see this by opening angular-seed/app/index.html in a browser. In Chrome, I get:

MLHttpRequest cannot load file:///path/angular-seed/app/partials/partial1.html. Cross origin requests are only supported for HTTP. index.html:1
Error: A network error occurred.
    at file:///path/angular-seed/app/lib/angular/angular.js:8113:11
    at sendReq (file:///path/angular-seed/app/lib/angular/angular.js:7915:9)
    at $http.serverRequest (file:///path/angular-seed/app/lib/angular/angular.js:7655:16)
    at wrappedCallback (file:///path/angular-seed/app/lib/angular/angular.js:11046:81)
    at wrappedCallback (file:///path/angular-seed/app/lib/angular/angular.js:11046:81)
    at file:///path/angular-seed/app/lib/angular/angular.js:11132:26
    at Scope.$eval (file:///path/angular-seed/app/lib/angular/angular.js:12075:28)
    at Scope.$digest (file:///path/angular-seed/app/lib/angular/angular.js:11903:31)
    at Scope.$apply (file:///path/angular-seed/app/lib/angular/angular.js:12179:24)
    at file:///path/angular-seed/app/lib/angular/angular.js:1341:15 angular.js:9509
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. angular.js:2666
XMLHttpRequest cannot load file:///path/angular-seed/app/partials/partial2.html. Cross origin requests are only supported for HTTP. angular.js:8113
Error: A network error occurred.
    at file:///path/angular-seed/app/lib/angular/angular.js:8113:11
    at sendReq (file:///path/angular-seed/app/lib/angular/angular.js:7915:9)
    at $http.serverRequest (file:///path/angular-seed/app/lib/angular/angular.js:7655:16)
    at wrappedCallback (file:///path/angular-seed/app/lib/angular/angular.js:11046:81)
    at wrappedCallback (file:///path/angular-seed/app/lib/angular/angular.js:11046:81)
    at file:///path/angular-seed/app/lib/angular/angular.js:11132:26
    at Scope.$eval (file:///path/angular-seed/app/lib/angular/angular.js:12075:28)
    at Scope.$digest (file:///path/angular-seed/app/lib/angular/angular.js:11903:31)
    at Scope.$apply (file:///path/angular-seed/app/lib/angular/angular.js:12179:24)
    at HTMLHtmlElement.<anonymous> (file:///path/angular-seed/app/lib/angular/angular.js:9298:22) angular.js:9509

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions