Tagged Questions
0
votes
2answers
10 views
AngularJS - How to access directly a $scope's row/value from the controller
I'm newbie in AngularJS but am very eager to master it, so please forget my ignorance. I have two problems making a basic blog:
Problem #1: I have a controller that uses $http and receives a JSON ...
0
votes
1answer
16 views
Object initialize different in Angular directive than controller?
I've have run into an issue with object initialization differing whether the code is in a controller vs a directive link function. In the example code below, the "this" parameter being passed in the ...
1
vote
2answers
39 views
How to push objects in AngularJS between ngRepeat arrays
So I'm new to AngularJS and I'm trying to build a very simple list app, where I can create an ng-repeat item list and then push a selected item into another ng-repeat list. Although my problem seems ...
-1
votes
2answers
43 views
Angular : How Inject html from controller
Something like this:
I would like to inject html from my controller to my scope without escaping it:
$scope.results = (typeof data.Clients[0] === 'undefined') ? '<span class="badge ...
0
votes
0answers
35 views
Angular .controller() runs before .run()
I have an ajax call inside the .run() that loads a variable into the $rootScope
That variable is needed in the controller associated with a view.
Sometimes on refresh (F5) by the time the .controller ...
0
votes
1answer
42 views
How can I call a service from a template in AngularJS?
I have a service that returns a json object that it makes, for brevity lets say it looks like this:
.service ('levelService', function () {
// service to manage levels.
return {
...
1
vote
1answer
46 views
AngularJS orderby / controller behavior: controller executed on orderby
I took a sample AngularJS app and began to change it to suit my needs. Now clicking to change the orderby causes the entire controller to be reloaded. Well that's where I'm initializing the default ...
1
vote
1answer
31 views
How to delay controller execution before service is done
I am trying to create an Angular service that runs before a controller is executed. I know I could use the 'resolve' properties of the controller but that makes me repeat that across all my ...
0
votes
1answer
70 views
Fire a directive at ng-click event in Angular
Let say that I have
<div ng-controller="MyController" ng-click="MyControllerFunction()" ng-tracking pageevent="button_clicked">click me</div>
I cannot change this structure at all and ...
0
votes
2answers
84 views
Sharing dynamic data between two controllers with service AngularJS
I have two angular services that need to share models (a list of messages and an individual message), which they get from a call to our API. The service is as follows:
angular.module('CmServices', ...
1
vote
1answer
103 views
Unable to inject `$http` using AngularJS explicit `app.controller` syntax?
I have been told that I should be using the app.controller syntax, in order to support minification.
Rewriting the sample (tutorial) example, and I found that I couldn't get it to work:
use ...
0
votes
2answers
209 views
Understanding dependency injection in AngularJS controllers
Just learning dependency injection, and I think I'm starting to understand it.
Please tell me if I'm on the right track...
E.g.: Are these two equivalent?
/* injection method */
function ...
0
votes
1answer
64 views
Error in controller with angular-google-maps in Angularjs
I have a problem with setting up my controller in angular js.
I want to use angular-google-maps (http://nlaplante.github.io/angular-google-maps/#!/usage)
I have my angular controller like this:
...
0
votes
1answer
54 views
Angular way to differ server model and client view model
I'm just wondering what is the best practice to view model data from server in Angular app?
For example in my controller i'm getting model from server (with custom ngResource service) and then I need ...
0
votes
1answer
79 views
AngularJS - controller and factory - where am I going wrong?
I'm new to Angular and cannot pinpoint where I am going wrong. I'm just trying to simply inject my factory into my controller, reference said controller within my html and use ng-repeat to present the ...