In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
3answers
739 views
ng-repeat repeating elements but not showing content inside ng-view
I have a controller:
function ItemsController($scope, $http){
$scope.init = function(){
$scope.siteItems = [
{id:'1', path:'img/1.png'},
{id:'2', path:'img/2.png'}
...
14
votes
4answers
24k views
Angularjs service callback to update scope of controller
A service with a 3rd party library callback function:
mbAppModule.service('aService', function ($http) {
this.data={"somedata":0};
var m3rdPartLib="init"; // init
...
0
votes
2answers
13 views
How to ng-repeat over a comma seperated string
I have an array as per below;
var myObj = {
paramA1: "some value",
paramA2: "a=1, set=2, of=332, comma=21, sep=12, values=01132"
}
$scope.myObj = myObj;
I want to display the above in my ...
0
votes
2answers
15 views
Access a variable inside watch by a directive in angular
I am new to angular and having some trouble with watch. I am watching a variable inside a controller. Once the variable's value has changed, I want to send this changed value to a directive.
Here is ...
0
votes
1answer
8 views
Re-evaluate directive attribute expression
I'm having troubles in re-evaluating an expression passed as attribute of a custom angular (1.2.28) directive.
I've tried all the possible combination of $eval, $parse as well as isolated and ...
6
votes
2answers
1k views
How to pass NgModelController to directive controller?
Can i pass NgModelController to directive controller? That's required so i can assign values to model in controller.
This example does not work:
angular
.module('directives.selectBox', [])
...
1
vote
1answer
16 views
Listen to mouse events in a custom directive in Angular
I have a custom directive called side-menu, which I can use at my index.html as follows.
<side-menu></side-menu>
Inside the directive, there is a controller. This controller is in a ...
0
votes
1answer
21 views
Displaying Nested Object Keys and Values Within ng-repeat
I have the follow array:
var myArray = [
{"cartItems": {"paramA1": 25, "paramA2": 35}},
{"cartShippingCost": {"paramB1": 4, "paramB2": 152, "paramB3": 536, "paramB4": 56}},
...
0
votes
1answer
32 views
Angularjs Controller is not initialized
I am working on on angularjs app and we need to integrate with another angularjs app. On click of a button on first app modal window and its content should get it form app2. I am trying below ...
0
votes
1answer
26 views
How to use ng-repeat in HTML page using AngularJS?
I need five independent fields based on the actual price and offer i need to find final price
This is my sample html code
addproduct.html
<tbody ng-repeat="a in [1,2,3,4,5]">
...
0
votes
0answers
15 views
Dynamic Scope for Custom Directives
I have an HTML structure with ng-repeat defined, like this:
<div class="wrapper" ng-repeat="item in mv.items">
<div class="some-complex-reusable-structure">
Using {{item}} here
...
0
votes
0answers
27 views
AngularJS - $scopes in services
So I have a service which I want to allow to listen to events that are fired elsewhere.
I found this question which gives a partial solution: How do i use $on in a service in angular?
However what ...
0
votes
0answers
10 views
Extend Angular ngClick directive and get it's input values or scope
I'm trying to create a directive thats called on every ngClick, Where i wanna log what the user click on.
i got it working like this.
app.directive('ngClick', function ($location, $http) {
...
0
votes
1answer
28 views
Angular passing variables to include file
After searching and trying lots of things, I can't seem to find a solution to pass a scope object into a include file.
I have tried
<span ng-init="list_title = clients_list.title;
...
0
votes
1answer
19 views
How to add user controller when using ui-router with nested views?
I'm using ui-router with nested views to display a few tables with user data on a user profile page. Here is an overview of the routes:
routes.config.js
(function() {
'use strict';
...
8
votes
6answers
7k views
AngularJS: Radio buttons do not work with Bootstrap 3
I have a radio button, which sets the value of True or False based on the value of transaction type
The demo can be found here
The problem is when I click on any of the radio button, the value of ...
1
vote
1answer
32 views
AngularJS: Unable to read radio button value in nested ng-repeat
I am creating a calendar like grid which generates numbers from 1 to 31 using two ng-repeats. Each element of the grid is a radio button, whose value I want to get inside a controller.
For example, ...
0
votes
4answers
22 views
AngularJS - why “Error: ng:areq Bad Argument”?
I am trying to follow this example but all I got is
Error: ng:areq
Bad Argument
Argument 'DefaultCtrl' is not a function, got undefined
Can anyone tell exactly why? DefaultCtrl is there, why it is ...
0
votes
3answers
57 views
AngularJS Calling ng-blur only once
I have two input box and need to concatenate value from first input box to other once value to second input box is entered.
Problem I faced doing this with ng-blur is it executes function multiple ...
0
votes
2answers
27 views
Dynamic grid using Angularjs
I have my code in different layers:
1. A factory that contains all of my $http request, and return the promise.
2. A controller that handles that promise with a then, to a assign it to a $scope ...
0
votes
2answers
25 views
How to display nested loop in html page using AngularJS?
I have JSON data I dont know how to write nested loop in angularJS.In here I am using two $index one is parent and anothe one is for child but its not working to me.
In here priceTag is a nested ...
3
votes
2answers
57 views
Angular: Automatically update a scope reference to an object defined in a service?
I have an angular app myAppwith a service myService, holding an object datathat is used by two Controllers, parentCtrl and childCtrl the latter inheriting from the former: ...
0
votes
2answers
35 views
Angular: Why Won't Model Update Outside Of View In Same Controller?
I have found a number of posts talking about models/views not updating, but I still can't figure this out. I'm new to Angular, btw so I suspect this is noob issue.
I have the below Angular app.
When ...
0
votes
2answers
48 views
AngularJS : How do access parent controller's scope item from the child directive?
My html view as below
School.html
<html>
<body>
<div class="col-xs-9">
<!-- major bootstrap html code goes over here -->
</div>
<div ...
0
votes
1answer
19 views
How to access a form in a modal from a controller
In my controller.js file I have:
angular.module('App').controller('AppCtrl', AppCtrl);
function AddApp(){
var vm = this;
vm.resetForm = resetForm;
function ...
0
votes
2answers
33 views
$scope and ng-model in the same directive
I have a directive that saves in a model in the Controller. It is a "text-button" (as per requirements) which is just a read-only textbox. There are three text-buttons per "Line" and 13 "Lines".
I ...
39
votes
10answers
43k views
How to detect browser using angular?
I am new to angular. How can I detect userAgent in angular. Is it possible to use that in controller? Tried something like below but no luck!
var browserVersion = int((/msie ...
115
votes
3answers
41k views
$rootScope.$broadcast vs. $scope.$emit
Now that the performance difference between $broadcast and $emit has been eliminated, is there any reason to prefer $scope.$emit to $rootScope.$broadcast?
They are different, yes.
$emit is ...
0
votes
1answer
27 views
How to open an external Angularjs html file using kendo-UI
I am new using Angularjs and KendoUI, I am trying to open multiple windows using kendoUI and add an angularjs html external file in it, the problem is when I attempt to open the window, the html page ...
0
votes
2answers
54 views
angular's $scope not updating?
I'm trying to create a basic weather app based on the user's location, which I take using javascript geolocation service. Everything regarding the location and weather works as expected.
My problem is ...
0
votes
2answers
34 views
AngularJS - function never gets control
First of all, I really hope for everyone's understanding and tolerance. This question is quite specific, so please no more radicalism, down-voting, putting on hold or abuse. We are all here to learn ...
-2
votes
2answers
50 views
How to check only one checkbox in angular?
Could you please tell me how to check only one checkbox at one time? I show a popup screen in which I display checked box. But user can select multiple checkboxes. I need to prevent that.I mean user ...
0
votes
1answer
31 views
How to get value of ng-change ionic/angular?
I m new in angularJS:
When I change the value of my input, in my console I don t have the new value.
How can I get the new value of my input when I change it?
controller.js:
$scope.nam = ...
1
vote
1answer
32 views
Using attribute containing 'start' in a directive doesn't work
I was trying to pass variables to a directive but I kept on running into issues with one of them constantly returning an 'undefined' value, even after reordering. It seems at first as though Angular ...
0
votes
0answers
17 views
Re-evaluate directive's link function to show tooltip when scope variable changes (angular strap)
I want to run the code under linkFunc of my changeAmount directive everytime a scope variable changes, which is managed by getGameUiStates.cellChanged()
The first time the page loads this works, but ...
3
votes
1answer
36 views
Model isn't updating when selected option changes
My Angular.js project features a select element bound to a model. On load the appropriate option is selected however selecting another option doesn't seem to update the model, at least not ...
0
votes
2answers
36 views
AngularJS service object is not being updated across views/controllers
I have a factory, "itemData", that holds a service.
app.factory('itemData', function () {
var itemData = {
Title: 'I should be different',
getTitle: function () {
...
10
votes
3answers
205 views
angularjs infdig error when change state on ui-router(with video)
New Edit: the authservice that checks the login:
'use strict';
angular.module('MainApp.login.services', [])
.factory('authService', ['AUTH_ENDPOINT', 'LOGOUT_ENDPOINT', '$http', ...
0
votes
3answers
56 views
AngularJS - $injector:modulerr Module Error in angular.js:36
First of all, I really hope for everyone's understanding and tolerance. This question is quite specific, so please no more radicalism / down-voting / putting on hold. We are all here to learn ...
0
votes
1answer
29 views
Sidemenu access ionic
Controller.js:
.controller('ParametresCtrl',['$scope','$stateParams','$state','cgtdata','$ionicPopup',
function($scope,$stateParams,$state,cgtdata,$ionicPopup) {
...
0
votes
1answer
23 views
Angular - Directive with controllerAs, bindToController, and $scope.$watch
I have a fairly straightforward AngularJS question to which I cannot seem to find an answer:
How would I go about using $scope.$watch() in a directive controller while also using the controllerAs and ...
1
vote
1answer
27 views
Angular Js: validating duplicate object key in table
I have a table with two column "user type" and "user Name" User type having a drop down selection So that i can select predefined user type and place a name in User name. There is a Add button on each ...
4
votes
1answer
19k views
AngularJs ng-if function call from same controller not working
<div ng-repeat=" x in z">
<div ng-if="function(x).y" >
display this
</div>
</div>
In the above code, ng-if function(x) is not getting called without ...
126
votes
6answers
171k views
How do I use $rootScope in Angular to store variables?
How do I use $rootScope to store variables in a controller I want to later access in another controller? For example:
angular.module('myApp').controller('myCtrl', function($scope) {
var a = ...
2
votes
3answers
4k views
Angular JS checkbox - model doesn't default to false
I have two checkboxes in my Angular JS form, like this...
<input id="isBackground" type="checkbox" ng-model="addTemplate.data.isBackground">
<input id="repeats" type="checkbox" ...
0
votes
0answers
12 views
ng-infinite-scroll-disabled paired with $scope.disabled
I've a problem to set the ng-infinite-scroll-disabled. The problem is that it doesn't work and when the user reaches the bottom of the page, the scroll isn't blocked, I can scroll more and multiple ...
2
votes
1answer
48 views
How to commit changes in a cell from code in slickgrid
I have used custom formatter and editor in slickgrid, which is simply checkbox angular directive. I am using twice the directive, once for formatter, and once for editor. Formatter and Editors are ...
0
votes
3answers
399 views
how do I inject `$rootScope` using TypeScript static injector pattern?
So, finally after getting a large model to compile in both angular and typescript, I get this runtime error:
10angular.js:12314 Error: [ng:cpws] Can't copy! Making copies of
Window or Scope ...
0
votes
0answers
26 views
custom directive does not load in md dialog
I am trying to load the chart through custom directive like below in the md dialog.
<md-dialog aria-label="Export" ng-cloak>
<md-toolbar>
<div class="md-toolbar-tools">
...
1
vote
1answer
20 views
ng-repeat is not working. Think there is a scope issue but not sure.
So I have the following div:
<div id="chatrooms" ng-controller="TableMsgController">
<section id="chatroom">
<div id="messages" >
<ul>
<li ng-repeat="entry in ...