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?

asked 30 Sep '14, 16:57

tandersen's gravatar image

tandersen
31224
accept rate: 0%


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

permanent link

answered 01 Oct '14, 12:12

tandersen's gravatar image

tandersen
31224
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×62
×30

question asked: 30 Sep '14, 16:57

question was seen: 3,264 times

last updated: 01 Oct '14, 12:12