In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
0answers
13 views
How to use ng-repeat in directive with isolate scope?
I'm trying to use ng-repeat in a directive that has an isolate scope, but I can't seem to get it working.
When I add an isolate scope to my directive, ng-repeat seems to not be able to see items, ...
0
votes
1answer
5 views
AngularJs broadcast repeating execution too many times
Inside one of my Angular controllers, I have this:
// controller A
$rootScope.$on("myEventFire", function(event, reload) {
someAction();
});
In another controller I have this:
// controller B
...
2
votes
1answer
13 views
angular js revert change of scope property inside a watch statement
I have a select box that needs that triggers an http put when it's changed.
html:
<select ng-model='color'></select>
js:
$scope.$watch('color', function(newValue, oldValue) {
...
0
votes
1answer
35 views
Angularjs, accessing rootScope or service from a nested directive
I have a sorting directive in the th cells of a list directive.
I am trying to sort the resource that is being used to populate the list when you click on the header of the cell, I want the sort to ...
0
votes
1answer
17 views
How to bind a transcluded template to a different controller?
I'm trying to pass a template through a directive to a dynamic controller (known at runtime from the directive perspective).
Something like this:
<my-dir ctrl="PersonCtrl">
...
0
votes
2answers
21 views
AngularJs Radio button list persist checked state to model
Better explain with a plunker
http://plnkr.co/edit/m8cvxA?p=preview
In a settings page that i work, Admin can set what defaults should apply for which site. In the plunker when you change your ...
0
votes
3answers
19 views
Get JSON value from key value array with Angular
Hi I am new to angular and just trying to learn how to do a few things. I have got stuck in trying to display the following data. Using the Batarang plugin for chrome i can see my restful webservice ...
0
votes
0answers
12 views
Do I have to execute func in child scope first for angular broadcast?
I have a nested scope structure.
Basically I have a function in child scope, I would like to call this function from parent scope. I used broadcast to achieve that. But the issue I encountered was I ...
0
votes
2answers
30 views
$watch's object not triggered when attributes are changed
I have one object:
$scope.obj = {bar: 'bar value', foo: 'foo value'};
and I want to to know if bar, foo or both change.
I'm doing this:
$scope.$watch('obj', function() { console.log("watching ...
0
votes
1answer
13 views
Local/Parent databinding won't work with directive isolated scope
I'm trying to achieve local/parent databinding using the scope: {test:"="} notation when defining a directive.
However, in the example below, despite the fact that console.log($scope.$parent); logs ...
1
vote
1answer
25 views
How to access a variable defined in an included file with angularjs?
I have a form like this:
my_file.html:
<form name='first_form'>
...
</form>
<div ng-include="'/includes/second_form.html'"></div>
<a ...
1
vote
3answers
27 views
Angular JS : $scope.data is undifined
I am new to Angular js. I tried following code.
<html>
<head>
<title>angular js</title>
<script src="js/lib/jquery.min.js"></script>
<script ...
1
vote
1answer
33 views
The correct way to inject an angular controller dependency inside an angular.ui modal
following angular.ui Modal example shows the modalInstance calling a ModalIntanceCtrl which is later created as a function:
var ModalDemoCtrl = function ($scope, $modal, $log) {
$scope.items = ...
0
votes
2answers
23 views
Angular - how do I use $resource
I have this controller that is working correctly for an Angular UI typeahead. How would I add the server call as a resource?
var receivableApp = angular.module('receivableApp', ['ui.bootstrap', ...
0
votes
3answers
62 views
Call a method of a controller from another controller using 'scope' in AngularJS
I am coding my first AngularJS app and I find it to be very good.
I am trying to call a method of second controller in first controller by using scope variable, this is a method in my first ...