Tagged Questions
0
votes
0answers
14 views
Unit testing a directive that defines a controller in AngularJS
I'm trying to test a directive using Karma and Jasmine that does a couple of things. First being that it uses a templateUrl and second that it defines a controller. This may not be the correct ...
0
votes
0answers
51 views
angularjs controller not binding to partial view
One of the two controllers (AboutCtrl) defined is working as expected. The default controller, TransactionCtrl is paired with the correct partial view but there isn't any angularjs magic happening. ...
0
votes
1answer
41 views
Accessing a directive from a controller in AngularJS: is there a proper solution?
My scenario, as shown in this jsfiddle: I have a directive which creates an empty iframe and attaches a load event which listens for clicks. On click calls scope.emitClick() in the controller, which ...
-2
votes
0answers
54 views
Nested service calls in a controller in angularjs
I want to call nested services inside a controller to fetch data based on id passed to service . It works in 1 st level when outer service is called inside the controller but inner service is not able ...
0
votes
1answer
44 views
communicate between angular controller and route controller
index.html
<body>
<div data-form-modal >
<form>
<input type='text' name='test'/>
<input type='submit' value='submit' ...
0
votes
0answers
32 views
Update element scope with controller via directive
so... i lost a lot of time on thinking how to fix this issue: http://jsfiddle.net/9AshA/5/
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
}
myApp.directive('usModal', function () ...
0
votes
1answer
71 views
Angular scope in jasmine controller tests
Trying to understand how do jasmine tests work.
I've got a module and a controller:
var app = angular.module('planApp', []);
app.controller('PlanCtrl', function($scope, plansStorage){
var plans = ...
1
vote
2answers
60 views
Angularjs: a Service that serves multiple $resource urls / data sources?
I have an Angular service/provider that serves json data to my controller which works great:
angular.module('myApp.services', ['ngResource']).
factory("statesProvider", function($resource){
...
0
votes
3answers
78 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
79 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
262 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
66 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
93 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
74 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
73 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 ...