status 404 with angular.js, but reachable via browser

I am running a simple LAN server on port 8089 which returns "hello" for any request:

class predict:
    def GET(self):
        return 'hello'

It is working fine when I access it via a browser. However, when I try to use angular.js, it keeps giving 404s. Firebug doesn't report any problems. Here is the HTML and angular code (which are in a local .html file):

<div ng-app>
<div ng-controller="TestCtrl">
<input placeholder="Type a word" type="text" ng-model="title"/><br/><br/>
Result = {{result}}

<script type="text/javascript">
function TestCtrl($scope, $http) {
    $scope.$watch('title', function (new_value) {
            $http({method: 'GET', url: ''}).
                    success(function(data, status, headers, config) {
                            $scope.result = data;
                    error(function(data, status, headers, config) {
                            $scope.result = status;

Any ideas why the behavior might be different in angular and browser?


It appears that cross-domain querying was the cause. I put the html file on the same server and everything is working fine now!

Need Your Help

how to detect keyevent in firefox

javascript firefox

I've write a web shell with javascript, but it doesn't work in firefox. But in IE and Chrome, it's fine. I've found that in firefox my script can't get the keyevent. So how can I fix this bug? Than...

How to use google places API

android google-places-api

I'm new to android programming and I want to ask how to get started with google places API. I've already searched so much on and I'm...