In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
1answer
15 views
Angular 1.5 directive with one-way binding updates parent scope
I have a directive with an isolated-scope and one-way binding variable.
yet when i change that variable in the directive controller it updates the parent scope as well.
Example code:
function ...
0
votes
0answers
34 views
Angular two forms, two ng-click, same function, only the first one runs
I have two forms on a page. The first adds an item to the database, and the second is prepopulated with the data and allows the user to modify the item. The first form allows the user to create and ...
1
vote
2answers
42 views
$scope variable do not respond to the onClick function of angular chart
I have a chart in the page. When one click in the chart, the onClick function will be called and it will know which category of the chart has been clicked by user. I created a div to show $scope....
0
votes
3answers
26 views
Angular JS : Error while getting data from typeahead
I am getting error while loading the module for angular JS in my Module, UI bootstrap here is not getting loaded despite of all the dependencies resolved.
can any one help me ?
Fiddle Link
https:/...
0
votes
1answer
14 views
Angular $destroy method not called on page navigation in Rails app
I have an application that uses both Angular and Ruby on Rails. Some of my Angular controllers create $interval timers that need to be cancelled when the user navigates to a new page. This Stack ...
0
votes
2answers
36 views
AngularJS - Factory variable doesn't update in controller
I'm facing a new issue with AngularJS.
Infact, since I need to have a "shared" variable, readable and updatable in 2 controllers, I thought about doing that with a factory injected in both the ...
0
votes
3answers
28 views
Access the main controller's scope from inside a directive
Suppose the following blueprint code:
<div ng-controller="myCtrl">
<div ng-repeat="...">
<div ng-repeat="...">
<div ng-repeat="...">
&...
0
votes
1answer
24 views
how to use google map in angularjs with script of key Without Google SDK
i don't want Google SDK, i have following code..i but its show error when i use tag its working fine but i am using angularjs its show error , normal page with script in page its working fine..how ...
0
votes
0answers
24 views
Calling link function as to reset message
Here is a part of my code:
<div class="col-xs-5 col-lg-5">
<select ng-model="criterion_id" ng-options="..." >
</select>
</div>
<div ng-if="criterion_id===1"&...
0
votes
1answer
19 views
How to toggle data in one directive using an ngClick function in another?
I'm building a weather app using Angular 1.5.8 and need to give users the ability to toggle back and forth between imperial and metric measurements for the temperature and wind speed.
The toggle ...
0
votes
0answers
14 views
Angular: Passed params in nested directive is of state “undefined”
We are following an example from http://mfauveau.github.io/angular-query-builder/ and modifying it to fit into our requirement.
We have a modal view(.jsp) that has integrated directive (named as '...
1
vote
1answer
21 views
AngularJS model update reverting back to original
http://plnkr.co/edit/3UMwSK6H5VL0pZujL7Qh?p=preview
Click edit and then cancel. The text boxes do not go away. Click cancel again, they go away. Please tell me why this is happening. I am losing my ...
0
votes
0answers
11 views
how to add google api script angularjs page
How to add this script in angularjs please help me..
when i click from page
ng-click="ListCtrl.Location(engineer)"
below method call and show other page
Location(engineer)
i have below HTML page ...
0
votes
1answer
27 views
AngularJS: Passing into a directive link function an attribute AND the entire scope
I have a directive that has an attirbute, it looks like this:
<directive config="myConfig"></directive>
This is my directives code:
app.directive("directive", ["$compile", ($compile)...
0
votes
2answers
21 views
Isolated scope's property does not affect its parent
Here is my code:
<html ng-app="myApp">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<body>
<div ng-controller="...
0
votes
0answers
34 views
AngularJS: How to add setter on $scope object property of directive?
This is my current implmentation to fire callback on customVar get change using $watch...
module.directive('mudirective', function() {
return {
scope: {
callback: '&'
...
0
votes
1answer
25 views
Accessing controller from compile function in directives
I have searched all over and the only thing I can come up with is that I don't understand something fundamental about how the compile function works.
Here is what I have
angular.module("app", [])
....
0
votes
1answer
30 views
Access controllers of multiple identical directives sharing the same parent scope
I am having trouble with an angular directive used an an attribute on a component. Basically, I want buttons to be draggable. I do it this way:
<body>
<xx-button xx-draggable>
<xx-...
0
votes
2answers
39 views
passing scope to directive in angular js
I have the following Angular controller with a simple http get in it:
angular.module('SCtrl', ['ng-fusioncharts']).controller('SCtrl', function($scope, $http) {
//Get All errors.
$http({
...
2
votes
1answer
40 views
Issue with protractor test case: Process exited with error 1
I'm fairly new to protractor and writing test cases.I tried to run this test case as shown below which is to open a page and click on "Home" which then takes back to another page added as expectation. ...
0
votes
0answers
33 views
$broadcast and $on is not working on single click
In my angularjs application I am using $emit and $on to show to different section of page.
For code refer to this link.
How to use $emit and $on of angularjs for two different controller stored in ...
0
votes
0answers
8 views
Angular 1 - How to use a Prototypal Scope and Bind values from Attributes without Watches?
I'm working with angular 1, and I'm currently wondering how to create a child directive that has a prototypal scope, and who contain an isolated value from an ng-repeat directive.
The following ...
0
votes
4answers
17 views
Persisting Scope beyond get request in Angular
I have the following code:
$http({
method: 'GET',
url: 'http://localhost:8080/getStuff'
}).then(function successCallback(response) {
$scope.stuffData= response.data.length;
}, ...
0
votes
1answer
51 views
angular service not returning success in controller after the work is done in service
I am calling a method inside a Service and when the work of service is done it should return to controller with the data,
and continue the work further, but after the service is called and data is ...
1
vote
3answers
51 views
AngularJS - split controller functions in multiple files
I'm new in AngularJS and I'm doing a refactor of an AngularJS application and I noticed that there is a single controller file with a lot of functions that manipulate and set scope variables.
...
-1
votes
0answers
6 views
how to show image in pop..page of information already pop page (nested pop)
i have below code i want to show image in pop... but the page of information its already pop page. how to show nested pop... please see code and picture
setGetImage(historyimage) {
console.log('...
0
votes
6answers
57 views
How get data in controller of both ng-repeat field along with outside ng-repeat field
I am working on angular Project.I have two divs. In one div there is dynamic input which generating through ng-repeat. Initially, two input will be available but if the euser clicks on add more than ...
0
votes
1answer
17 views
Merge two SCOPES from separate sources (same construct)
I have a function
var getData = function() {
$http.get('(url of remote site)/swi/20?expand=true').success(function (data) {
$scope.listOfServices = data.runningServices;
});
};
Which ...
0
votes
2answers
28 views
convert array into an object angularjs
I have a contoroller:
$scope.getFromDB=function(data)
{
$scope.nameSelected=[];
var myCookie=$cookie.get("nameCookie");
$scope.names= data;
for(var i=0; i<$scope.names.length;i++)
{
if($...
0
votes
0answers
19 views
Status of newly opened window in AngularJS/JQuery
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-...
0
votes
2answers
31 views
Model updates in directive do not update view
angular.module('myApp')
.component('sideNav', {
controller: function SideNavController($scope) {
$scope.navigation = {};
$scope.click = function(key) {
$scope.navigation[key] = !$...
0
votes
1answer
64 views
How to use $emit and $on of angularjs for two different controller stored in different path
I have two views and its resp controller.
Say
view1.html and its controller firstCntrl
and
view2.html and its controller secndCntrl.
In view1.html:
There is Link2 which will be redirected to ...
0
votes
3answers
32 views
usage of ng-if and ng-switch inside ng-repeat fails
I am trying to compare userId with currentuserId and when the condition of action is approve i am trying to populate checkboxes. But my ng-if seems to be failing always. How can i do this better . ng-...
0
votes
1answer
15 views
dynamically Build ng-template using list
I am trying to build ng-template dynamically, In the Data structure, I have a Object that contains list of object of same type or other type of object.
[
{
...
0
votes
2answers
21 views
unable to retrieve value inside the ng-repeat
I am trying to manually add values to the response that i got from the REST API and use it inside the View . The problem is i am not able to acess the manually added item inside the ng-repeat . Let me ...
0
votes
0answers
25 views
Angularjs array changes its syntax when it has only one record
I am using an angularjs array to store the record data(table rows) received by using the http.get rest API and printing using an ng-repeat. The problem is whenever there is only one record retrieved ...
1
vote
1answer
16 views
WYSIWYG shortcode to AngularJS function
I have a custom WordPress shortcode that when used in a WYSIWYG returns a bunch of html with an Angular function attached.
Below is an example of what I am trying to do.
Shortcode:
add_shortcode('...
0
votes
1answer
30 views
cannot access directive's scope object in directive's controller
MaterialIn.directive.js
angular.module('mdt')
.directive('mdtMaterialins', materialInsDirective);
function materialInsDirective() {
return {
restrict: 'E',
scope: {
...
0
votes
0answers
13 views
not working Display blob (.pdf) in an angular app
i am done pdf download in my app. the pdf file is download successful but some error gets this:
Failed to load PDF document
here is my js code:
$scope.downloadFile = function () {
$...
0
votes
3answers
22 views
How to ng-if use when its value is “”?
How to use ng-if? I have below code. If image_path not null show td otherwise not. My code does not work.
ng-if="hs.image_path != """
<td ng-if="hs.image_path != """><img id="...
0
votes
0answers
28 views
Write data from input to Firebase database
I wanna send data from input towards Firebase database using $scope. I don't know how can I send from $scope all data towards firebase database.
Here is the html code :
<div ng-app="angularjs-...
0
votes
0answers
32 views
Not able to use a two-binding in Directive in angularJS
I am using a controller like this
app.controller('EmployeeCrtl', ['$http', '$scope', function($http, $scope) {
$http.get('/Data/EmployeeDetails.json').success(function(data) {
$scope....
1
vote
2answers
38 views
How to refresh directive that existed in template and directive has own scope for data
I have - ng-view - template create item functionality and same template containing one directive that load the saved items.
Now, when i do save create item and immediately, its not refreshing list of ...
1
vote
3answers
59 views
Angular JS Adding options to drop down menu on ng-click not working properly
I am pretty new to angularJS. I am trying to create an interface for the user where he will be able to select exactly two items from two drop down list. They are actually the same options. When the ...
0
votes
1answer
28 views
passing parameter to directive in Angularjs
I have the following directive:
angular.module('SuperCtrl').directive('listDirective',function(){
return {
restrict:'E',
scope: {
title:"="
},
templateUrl: '../templates/...
0
votes
0answers
14 views
Does it ever make sense to use $scope.$new(true,scope)?
An Angular $scope has the method
$new(isolate, parent) where:
isolate (boolean): If true, then the scope does not prototypically inherit from the parent scope. The scope is isolated, as it can not ...
0
votes
2answers
35 views
What method should be attached to $scope?
I am new to AngularJS, and have WPF MVVM experience before. Now, I'm very confused with $scope, it looks like it is a viewmodel, we can define functions on it and use ng-change, ng-click or some other ...
0
votes
0answers
18 views
View updating intermittently between page loads with an array change in angularjs
I have two components (contacts and notes) loading on the same page (from the main component) which both have simple http requests to add and delete information. They are only updating the view ...
0
votes
1answer
36 views
AngularJS - Update controller var on route change
I'm pretty much a newbie in the AngularJS world.
This is my problem. I would like to update the selected tab based on the url, so that the selected tab changes when the url changes.
This is my js:
...
1
vote
2answers
36 views
Why will always use anonymous function in AngularJS
I see almost tutorial use anonymous function in AngularJS, instead of normal function, like function name(para1) {}. Please see this link: http://www.w3schools.com/angular/tryit.asp?filename=...