The angularjs-factory tag has no wiki summary.
0
votes
3answers
762 views
AngularJS : factory and controller
I'm new to angular and I am trying to structure my app following https://github.com/angular-app/angular-app
The issue is when I defined my factory and controller...
app.service
...
0
votes
3answers
974 views
Passing a MySQL query result to AngularJS through php
I need to count a table in a mysql database, and for this I need to use php. I use the following code, counttable.php:
$query = "SELECT COUNT(*) FROM table";
$result = mysqli_query($connection, ...
1
vote
2answers
330 views
services are not included in angularjs
I have integrated requirejs with angularjs app.
Now I am getting errror 'Provider commonService must define $get factory method. from myApp '
How can i include services with requirejs ?
Here I am ...
1
vote
1answer
92 views
Inject a dependency into a angular factory and access the dependency
I have added with bower the angular-moment library.
I followed the how-to of the angular-moment author and added also both scripts to my index.html file and to the karma.conf.js file with the files ...
1
vote
1answer
93 views
AngularJS - Dependency injection involving asynchronous data
I want to make the currently logged in user's ID and user name available to my Angular directives. I have created an API end-point to retrieve this information (along with some other information).
...
1
vote
1answer
188 views
creating a service with yo angular:factory test fails to load testProvider
i am trying to inject a factory onto a controller using the angular fullstack generator and am having issues with the provider not found, where am i going wrong?
i created an app with
npm install -g ...
0
votes
1answer
31 views
Persistent entities (JSON objects) in AngularJS
I'm primarily a C# and Java developer. Quite a newbie to JavaScript and AngularJS.
I'm developing a web app and I want to architect the app in the following manner :
Topmost layer : The views and ...
0
votes
1answer
93 views
cordova, ionic framework and angularJS - angular datafactory behaviour
I'm new to cordova, Ionic framework and angular and have hit a road block with using a factory .
my factory is setup as follows:
angular.module('test.factories', ['ionic'])
...
0
votes
1answer
14 views
Can I create a factory to create servicesin AngularJS?
I have this service I'd like to use, but it could happen that some parts of my application require the same service but with different parameters to use internally. Since services always refer to the ...
0
votes
1answer
210 views
Loading factories dynamically (on demand) with AngularJS
Following Dan Wahlin's article on dynamically loading controllers and views ...
0
votes
1answer
177 views
How to access the $scope where the factory was injected?
Say I have a factory named MyFactory and I inject it into several controllers. How can I access the controllers scope inside the factory?
The only way I currently think of on how to do this is as ...
0
votes
1answer
101 views
How to access the data returned by roles by factory in the controller?
app.factory('myService', function ($http) {
var serviceurl = 'http://localhost:12345/Area/Controller/Action/';
var roles = [];
function getRole(id) {
//alert(id);
$http.get(serviceurl + ...
0
votes
1answer
2k views
AngularJS Bind Data returned from Async Call in ngrepeat
I have an index.html file which I'm using as a layout/template with a header, ngview directive and footer. I'm using the 'resolve' property successfully on the views rendered in ngview to show data ...
0
votes
1answer
2k views
AngularJS - http POST request getting “SyntaxError: Unexpected token {” when sending JSON
SOLVED:
The problem was with the second echo in my php script. for some reason it was messing up my stuff. Once I only left the first echo, everything seemed to work perfectly fine.
I am trying to ...
-1
votes
1answer
46 views
Troubleshooting the mechanics of web.
I am trying to call an Web API Get method for getting the data but I am getting this exception::
{"Message":"An error has occurred.","ExceptionMessage":
"The 'ObjectContent`1' type failed to ...
2
votes
0answers
47 views
AngularJS $rootScope in factory - reload data
I have a factory calling a $resource. Upon refreshing the application entirely, this works as planned. But it not call the resource again throughout navigating the application. Ideally i would like ...
1
vote
0answers
1k views
How to navigate to a child state using parameters from a factory using Angular.js and ui-router?
I'm trying to get angular ui-router to navigate to a child state using a parameter supplied by a factory which has a default parameter at the start in order to preserve the parameters across the app.
...
0
votes
0answers
22 views
getting : undefined is not a function on getting collection from web-api
I have a web api which returns IHttpActionResult(myCollection) on Get.
My angular JS controller is has a function :
$scope.loadcollection = function($defer, params) {
console.log("inside ...
0
votes
0answers
23 views
Isolating large amounts of information into factories from controllers (AngularJS)
I'm a little new to Angular, so I'm not really sure what the standards are when it comes to writing an app that has something like this.
I had some functions and content I needed to share across ...
0
votes
0answers
44 views
angularjs http request, able to receive post data on firefox not on chrome
I am creating a http factory on angularjs for my application, the data being posted is to get received in a php controller.
The data gets received on firefox but on chrome i receive nothing.
The ...
0
votes
0answers
18 views
Using a provider inside another provider
I am creating an app that relies on socket.io for real-time notifications. There is a listener that gets triggered when a redis message gets published. This redis listener needs to be global and the ...
0
votes
0answers
32 views
AngularJS factory and controller
little problem here, i have a controller which communicate with factories, but how can i pass the factory result to a function? Something i tried:
.controller('testCtrl', ['$scope', 'foo', 'boo', ...
0
votes
0answers
135 views
Angularjs reset state of factory
I have a service that makes a GET request and passes a start param. The start param is incremented within the factory
this.start++
When i click on a link the service needs to make a request but ...
0
votes
0answers
103 views
Uncaught TypeError: Cannot read property 'loadDataToGrid' of undefined
I have a code that uses to load data passing from the sever side into a jQGrid. I'm using an AngularJS factory method to initiate the call and return received json document. I'm getting Uncaught ...
0
votes
0answers
56 views
AngularJS: CORS error while using $resource
I am using Angular 1.2.3 and using $resource to get data from server using following code.
$resource("http://11.11.11.11/url/index.php",
...
0
votes
0answers
64 views
angularjs on loadmore append to existing model using ng-repeat by caling a service
I have a profile page where in the model is loaded by a call made through a service via php that returns profiles, on click of load more how do I push data to the existing model and update the data.
...
0
votes
0answers
139 views
How to send parameters to a $resource inside a Factory on AngularJS
I've got an AngularJS factory which provides a $resource connected to an API. Something like this:
app.factory('Collection', function($resource, Global){
return $resource(
...
0
votes
0answers
40 views
What is the preferred method for defining data source factories in Angular JS?
In a web project, I have defined an AngularJS dataSourceFactory that will contain all data sources.
app.factory('dataSourceFactory', function (abstractDataFactory, customFunctions) {
var ...
0
votes
0answers
43 views
Using $resource with Wordpress JSON plugin
Right now, I have my factory set up like I have posted below; however, I'm trying to switch over to using an API rather than a static JSON file, but can't figure out how to get the data.
...
0
votes
0answers
18 views
Is it ok to use this.varname in a AngularJS factory?
I have created a factory where I need to pass in values. I have found 2 ways to do this. The first uses this.Value1 = '';
app.factory('srvOrg', function ($http) {
this.Value1 = '';
...
0
votes
0answers
23 views
Random path for $resource in factory
I have such code in services.js for AngularJS app
factory('Agent', function($resource) {
var Agent = $resource(get_random_server() + '/agent/show',
{ callback: 'JSON_CALLBACK' }, {
...
0
votes
0answers
311 views
Getting Data In AngularJs From WebSql
I am developing android app using AngularJs, JQuery Mobile with JQM-AngularJS Adapter and for server side i use JayDatato generate DataBase and then dumb data in WebSql.
Now i want to get data from ...