Skip to main content
edited body
Source Link
Nasreddin
  • 1.7k
  • 9
  • 32
  • 36

This is my first AngularJS project. I followed this website to create a simple html to display a single record by calling restful services. The rest works with the url "http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009". enter image description here

Here is my html:

<html ng-app="cgApp" npng-controller="CgseqCtrl">
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-resource.js"></script>
    <script src="../js/controller.js"></script>
  </head>
  <body>
    <div>
        <hr>
            <h2>{{seq.analysisId}}</h2>
            <h2>{{seq.library}}</h2>
        </hr>
    </div>
    
  </body>
</html>

I defined the resource in a service js

//service.js
angular.module('cgApp', ['ngResource'])
.factory('CgseqService', function ($resource) {
        return $resource('http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009',
            {get: {method: 'GET'}
        });
});

The controller:

//controller.js
angular.module('cgApp', ['ngResource'])
.controller('CgseqCtrl', ['CgseqService', '$scope', function (CgseqService, $scope)
{
    $scope.getSeq = function(response) {
        CgseqService.get(function(data) {
            $scope.seq = data;
        });
    };
}]);

When I started my http server with Node.js and typed the url in the browser, nothing is displayed. What did I do wrong?

This is my first AngularJS project. I followed this website to create a simple html to display a single record by calling restful services. The rest works with the url "http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009". enter image description here

Here is my html:

<html ng-app="cgApp" np-controller="CgseqCtrl">
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-resource.js"></script>
    <script src="../js/controller.js"></script>
  </head>
  <body>
    <div>
        <hr>
            <h2>{{seq.analysisId}}</h2>
            <h2>{{seq.library}}</h2>
        </hr>
    </div>
    
  </body>
</html>

I defined the resource in a service js

//service.js
angular.module('cgApp', ['ngResource'])
.factory('CgseqService', function ($resource) {
        return $resource('http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009',
            {get: {method: 'GET'}
        });
});

The controller:

//controller.js
angular.module('cgApp', ['ngResource'])
.controller('CgseqCtrl', ['CgseqService', '$scope', function (CgseqService, $scope)
{
    $scope.getSeq = function(response) {
        CgseqService.get(function(data) {
            $scope.seq = data;
        });
    };
}]);

When I started my http server with Node.js and typed the url in the browser, nothing is displayed. What did I do wrong?

This is my first AngularJS project. I followed this website to create a simple html to display a single record by calling restful services. The rest works with the url "http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009". enter image description here

Here is my html:

<html ng-app="cgApp" ng-controller="CgseqCtrl">
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-resource.js"></script>
    <script src="../js/controller.js"></script>
  </head>
  <body>
    <div>
        <hr>
            <h2>{{seq.analysisId}}</h2>
            <h2>{{seq.library}}</h2>
        </hr>
    </div>
    
  </body>
</html>

I defined the resource in a service js

//service.js
angular.module('cgApp', ['ngResource'])
.factory('CgseqService', function ($resource) {
        return $resource('http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009',
            {get: {method: 'GET'}
        });
});

The controller:

//controller.js
angular.module('cgApp', ['ngResource'])
.controller('CgseqCtrl', ['CgseqService', '$scope', function (CgseqService, $scope)
{
    $scope.getSeq = function(response) {
        CgseqService.get(function(data) {
            $scope.seq = data;
        });
    };
}]);

When I started my http server with Node.js and typed the url in the browser, nothing is displayed. What did I do wrong?

deleted 28 characters in body
Source Link
Josh Beam
  • 19.9k
  • 5
  • 48
  • 69

This is my first AngularJS project. I followed this website enter link description herethis website to create a simple html to display a single record by calling restful services. The rest works with the url "http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009". enter image description here

Here is my html:

<html ng-app="cgApp" np-controller="CgseqCtrl">
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-resource.js"></script>
    <script src="../js/controller.js"></script>
  </head>
  <body>
    <div>
        <hr>
            <h2>{{seq.analysisId}}</h2>
            <h2>{{seq.library}}</h2>
        </hr>
    </div>
    
  </body>
</html>

I defined the resource in a service js

//service.js
angular.module('cgApp', ['ngResource'])
.factory('CgseqService', function ($resource) {
        return $resource('http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009',
            {get: {method: 'GET'}
        });
});

The controller:

//controller.js
angular.module('cgApp', ['ngResource'])
.controller('CgseqCtrl', ['CgseqService', '$scope', function (CgseqService, $scope)
{
    $scope.getSeq = function(response) {
        CgseqService.get(function(data) {
            $scope.seq = data;
        });
    };
}]);

When I started my http server with Node.js and typed the url in the browser, nothing is displayed. What did I do wrong?

This is my first AngularJS project. I followed this website enter link description here to create a simple html to display a single record by calling restful services. The rest works with the url "http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009". enter image description here

Here is my html:

<html ng-app="cgApp" np-controller="CgseqCtrl">
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-resource.js"></script>
    <script src="../js/controller.js"></script>
  </head>
  <body>
    <div>
        <hr>
            <h2>{{seq.analysisId}}</h2>
            <h2>{{seq.library}}</h2>
        </hr>
    </div>
    
  </body>
</html>

I defined the resource in a service js

//service.js
angular.module('cgApp', ['ngResource'])
.factory('CgseqService', function ($resource) {
        return $resource('http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009',
            {get: {method: 'GET'}
        });
});

The controller:

//controller.js
angular.module('cgApp', ['ngResource'])
.controller('CgseqCtrl', ['CgseqService', '$scope', function (CgseqService, $scope)
{
    $scope.getSeq = function(response) {
        CgseqService.get(function(data) {
            $scope.seq = data;
        });
    };
}]);

When I started my http server with Node.js and typed the url in the browser, nothing is displayed. What did I do wrong?

This is my first AngularJS project. I followed this website to create a simple html to display a single record by calling restful services. The rest works with the url "http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009". enter image description here

Here is my html:

<html ng-app="cgApp" np-controller="CgseqCtrl">
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-resource.js"></script>
    <script src="../js/controller.js"></script>
  </head>
  <body>
    <div>
        <hr>
            <h2>{{seq.analysisId}}</h2>
            <h2>{{seq.library}}</h2>
        </hr>
    </div>
    
  </body>
</html>

I defined the resource in a service js

//service.js
angular.module('cgApp', ['ngResource'])
.factory('CgseqService', function ($resource) {
        return $resource('http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009',
            {get: {method: 'GET'}
        });
});

The controller:

//controller.js
angular.module('cgApp', ['ngResource'])
.controller('CgseqCtrl', ['CgseqService', '$scope', function (CgseqService, $scope)
{
    $scope.getSeq = function(response) {
        CgseqService.get(function(data) {
            $scope.seq = data;
        });
    };
}]);

When I started my http server with Node.js and typed the url in the browser, nothing is displayed. What did I do wrong?

Source Link
Nasreddin
  • 1.7k
  • 9
  • 32
  • 36

REST call in AngularJS does not display record

This is my first AngularJS project. I followed this website enter link description here to create a simple html to display a single record by calling restful services. The rest works with the url "http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009". enter image description here

Here is my html:

<html ng-app="cgApp" np-controller="CgseqCtrl">
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-resource.js"></script>
    <script src="../js/controller.js"></script>
  </head>
  <body>
    <div>
        <hr>
            <h2>{{seq.analysisId}}</h2>
            <h2>{{seq.library}}</h2>
        </hr>
    </div>
    
  </body>
</html>

I defined the resource in a service js

//service.js
angular.module('cgApp', ['ngResource'])
.factory('CgseqService', function ($resource) {
        return $resource('http://localhost:8080/api/seqs/fdebfd6e-d046-4192-8b97-ac9f65dc2009',
            {get: {method: 'GET'}
        });
});

The controller:

//controller.js
angular.module('cgApp', ['ngResource'])
.controller('CgseqCtrl', ['CgseqService', '$scope', function (CgseqService, $scope)
{
    $scope.getSeq = function(response) {
        CgseqService.get(function(data) {
            $scope.seq = data;
        });
    };
}]);

When I started my http server with Node.js and typed the url in the browser, nothing is displayed. What did I do wrong?