on 2014 Sep 30 5:57 PM
Trying to build a angularjs single page web application using SQL Anywhere 16 creating web service. using nginx as a web server.
my problem is in the web service ... I cannot quite get the header created correctly for it to be used by the application. I create two application exactly the same code the difference is one line one pulls from a outside web service that works and mine pulls from Sybase that does not work.
the code that is different
angular.module('myApp.services', ['ngResource']) .factory('AngularIssues', function($resource){
return $resource('https://api.github.com/repos/angular/angular.js/issues', {})
// return $resource('http://[my ip]:8086/tmws/vb_wot', {})
})
.value('version', '0.1');
i changed the nginx to pull my web service through as proxy eliminating the Same origin Policy however that seems to be the inaccurate error that is showing in the console.
when I run this in the browser inspecting the network I get the line of vb_wot Method OPTIONS
I set the Content-Type:application/json; charset=utf-8
I need a proof of concept for a meeting I'm going to.
Does anyone has a sample that works with angularjs?
found my sample code took it from a tutorial https://docs.angularjs.org/tutorial I stopped at Step 6 replaced the $http.get with my own IP just a note my nginx is using port 8086 and my service is 8084 using nginx proxy to make same location
phonecatApp.controller('PhoneListCtrl', function ($scope, $http) { $http.get('http://88.88.88.88:8086/tmws/vb_wol').success(function(data) { $scope.phones = data; });
$scope.orderProp = 'age'; });
Have a proof of concept ... nice, I fly out tomorrow
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.