Skip to main content

All Questions

Filter by
Sorted by
Tagged with
-3 votes
2 answers
449 views

What is the difference $scope.$parent vs $broadcast?

What is the difference between $scope.$parent and $broadcast?
abhinav prathapagiri's user avatar
1 vote
2 answers
137 views

In AngularJS, if the child directive cannot access it's immediate parent's scope then would it inherit its nearest, non-isolated ancestor's scope?

I have two examples in favor of the above statement - 1) When using $scope (http://plnkr.co/edit/kFM77mVReS7AUwZsNzCV?p=preview) - <!DOCTYPE html> <html> <head> <script ...
Rachit Belwariar's user avatar
4 votes
2 answers
14k views

AngularJS +1.5 How can a Parent controller pass data to a component Controller

I have a component like: Check Plunkr Example ( Updated and Working with the solution :) Thanks ) my-component.js declaration (function() { 'use strict'; angular .module('app') ....
H�ctor Le�n's user avatar
0 votes
1 answer
61 views

Confuse about angular custom directive scope inherit

I define a custom directive in a controller, I have already define some variable in the controller's $scope. myapp.controller('demoController', function ($scope) { $scope.userInput = "...
hh54188's user avatar
  • 15.7k
2 votes
4 answers
5k views

AngularJS: variable $scope inside a function appears undefined outside the function

I am new with AngularJS and I am stuck :\ NEED HELP, please! The purpose of the code below is to get a specific data (an integer) from a DB in order to build a doughnut chart. I run the function ...
Filipe Santos's user avatar
0 votes
1 answer
69 views

AngularJS function inherit

I have angular JS with 5 controllers and I want to all of the children inherit all functions of parent (datetimepicker, autorefresh etc.. that is predefined in parent controller) I tried with ...
Aviator's user avatar
  • 613
2 votes
1 answer
475 views

Inheritance w/ Angular's 'Controller As' vs. $scope

tl:dr; I want to consider the 'controller as' approach to simplify my inheritance process however I see some pitfalls around dependency injection and use in directives. preface I've been working on a ...
jusopi's user avatar
  • 6,813
0 votes
0 answers
493 views

Extend rootScope with alert service?

I can easily envision myself injecting my alert service into almost every one of my controllers: myApp.factory('AlertsList', function () { return [{ type: 'info', msg: 'Welcome!'}, ...
A T's user avatar
  • 14k
0 votes
1 answer
141 views

Scope of embedded angular directive

I created two directives, lets say A and B: <A> <B /> </A> A is a transclude. And A's and B's scopes are inherited from their ng-controllers. I want to connect A and B ...
Iliya Garakh's user avatar