In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
1answer
30 views
Angular - getting value of certain key in $scope
I'm trying to create a simple application using Meteor/Angular/TypeScript/mongoDB. The plan is to draw charts according to data coming out of a database. It's looking like this:
export const Database ...
-3
votes
0answers
24 views
How to pass a $scope var from the controller to a directive? [duplicate]
How can I access the $scope.jobs variable from the 'job' directive shown at the bottom.
angular.module('Home')
.controller('HomeController',
['$scope', '$rootScope', '$location', '...
0
votes
0answers
25 views
Angular Js: Image Slider not working after scope update
I am trying to show image slide in angular js. When the page loads the images are showing properly. I have a search button (which will be a default string at the starting of the page) when try to ...
11
votes
2answers
12k views
What is the default for AngularJS directive scope?
What is the default scope value of an AngularJS directive?
Of course, it is not isolated scope. It is true or false.
I can't find any documentation on what it is.
0
votes
1answer
23 views
Why might we reference $scope.model in angular code?
I'm working on some code that references $scope.model. So my understanding is that in angular the $scope essentially represents the model anyway.
In the code I'm working on certain properties have ...
73
votes
4answers
61k views
Scope issues with Angular UI modal
I'm having trouble understanding/using the scopes for an angular UI modal.
While not immediately apparent here, I have the modules and everything set up correctly (as far as I can tell), but these ...
0
votes
1answer
13 views
Is $on and $broadcast in different controllers possible
Is it possible to put $scope.broadcast and $scope.$on in different controller? I'm trying to make a global search wherein once I enter a text, the data will direct to the controller responsible for ...
940
votes
15answers
397k views
How do I access the $scope variable in browser's console using AngularJS?
I would like to access my $scope variable in Chrome's JavaScript console. How do I do that?
I can neither see $scope nor the name of my module myapp in the console as variables.
0
votes
1answer
31 views
How to optimize AngularJS config function
I have following config functions and run functions in my app.js file. What is the best way to optimize these function method ? can we move these into one single config function ?
Or Can we move these ...
0
votes
0answers
34 views
Issue Angularjs Controller and json request
I'm learning angularjs, I was trying with a json file but not working properly because comic-detail.html displays all lists of json file, should display the content of the link requested in comics....
2
votes
2answers
38 views
Scope from controller does not pass to directive
I have a html like this :
<div id="create-group" ng-controller="groupCreateController">
<div id="container">
<h1>Create group</h1>
<div class="...
1
vote
1answer
234 views
Dynamically binding custom directive to ng-repeat
my controller has the json for my form then i have a directive that gets repeated to produce the form elements. based on the 'type' passed to the directive, the directive should know how to render ...
0
votes
1answer
20 views
Directives in transcluded view are childScopes altough they have `scope:false`
I'm writing a fairly complex AngularJS app in Angular 1.5. One particular part of it is aimed at data visualization.
With few exceptions, data visualization is handled by bundled plugins, each with ...
0
votes
0answers
108 views
Angular2 rc1 Http Get
I agree, one should not jump to new technologies when they are in beta stage, but its a good way to learn. However, which the recent changes in angular2, I am kinda stuck, as there is no helpful way ...
0
votes
1answer
28 views
$watch not firing on variables with a dollar ($) [duplicate]
i have a watch for an object. when a property of the object changed, the watch fires, unless the property name starts with a dollar ($).
consider this code:
$scope.data = {};
$scope.$watch('data', ...
0
votes
1answer
31 views
handle APlayer through angular js - play music dynamically
I am new to angular js - trying to build an audio play using Aplayer
Task:-
1. Play music dynamically
2. On click of album get json data and add to aplayer
(function() {
'use strict';
...
2
votes
2answers
1k views
Submit form on page load in Angular
I would like to submit a search form on page load if search terms were specified in the route. The problem is that searchForm isn't defined yet when search() runs. I've seen others get this to work by ...
0
votes
1answer
19 views
angularjs data binding disappearing- Failing silently
I can not create complex data models in my controllers.
every time I create them the code seems to fail silently
simple data models like
$scope.conversationList = [123456];
work just fine both ...
0
votes
1answer
31 views
Send callback to non isolated scope child
I need to add a callback to a child directive, that is not an isolated scope. I know you can do it with an isolated scope, you can also use scope.$parent to access it, however this isn't always ...
0
votes
0answers
33 views
Sharing scope variable between sibling directives
I'm working on a table that can be expanded/collapsed by clicking on the header bar. To accomplish this, I have two directives that appear in the markup as siblings: slideToggle and slideable. I ...
0
votes
2answers
25 views
radio buttons not initializing correctly when entering a new page
I have a simple form that gets it's initial values from an object that I pass into the form's controller. Other models are displaying the correct values, but the correct radio button is not being ...
899
votes
13answers
439k views
What is the difference between '@' and '=' in directive scope in AngularJS?
I've read the AngularJS documentation on the topic carefully, and then fiddled around with a directive. Here's the fiddle.
And here are some relevant snippets:
From the HTML:
<pane bi-title="...
-2
votes
0answers
23 views
Need help converting $stateProvider functionality into $routeProvider
In my codebase I use $routeProvider, but I want to include functionality similar to this $stateProvider example.
What would be the $routeProvider equivalent to the following code?
angular
.module(...
0
votes
1answer
29 views
Trigger a function when user makes dropdown menu selection
I'm working on an application for project management. Each project has a list of tasks associated with it.
I'm currently trying to get the modify task page to work. The idea is that:
User selects a ...
-7
votes
0answers
45 views
Which one is better among MVC, angular js, angular 2 and angular 4? [closed]
I am developing a new web application (product) which have around 80 forms and 30 reports.
I have read many documents related to MVC,angular js, angular 2 and angular 4.
Angular is client side ...
83
votes
7answers
114k views
How do I inject a controller into another controller in AngularJS
I'm new to Angular and trying to figure out how to do things...
Using AngularJS, how can I inject a controller to be used within another controller?
I have the following snippet:
var app = angular....
-1
votes
1answer
40 views
AngularJS On selecting radio button set select field value
How do I set the select fields value by clicking radio button
-1
votes
2answers
35 views
Angular iterator in controller
I have a Json objects, which contains one field with date, I need to take it and prepare for other processing, but I don't know how to take just one field from one object, I tried to do that:
app....
0
votes
1answer
16 views
How do I access angular's $scope.{{formName}}.$dirty boolean with TypeScript?
I have a form with a name attribute, and I'm trying to use angular's $scope variable to access the form, and its $dirty boolean.
The problem is I'm using TypeScript, and if I set the type for a $...
0
votes
1answer
56 views
angularjs input field not updating after calling $(“.myItem”).dateInput()
My angular input fields are working fine, until I have a datetime editor.
<input class="myItem" defaultdate="2017-05-10T06:50" displayformat="dd-mm-jjjj uu:mm" pageupdownweek="true" ...
48
votes
11answers
82k 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 (\d+)/.exec(lowercase(...
2
votes
6answers
1k views
AngularJs: pass $scope variable with service
I have two controllers and in one of them I declared a $scope variable that I would like visible in the second controller.
First controller
app.controller('Ctrl1', function ($scope) {
$scope....
1
vote
1answer
52 views
How to feed data to a schema inside an AngularJS directive
I am trying to write a custom directive that will "create" a dashboard widget including:
Title (the name of the widget)
Schema (the way the data should be modelled or shown, i.e. it could be the ...
0
votes
4answers
47 views
How to transfer the data between controllers
I tought angular and faced with a problem: I have a SPA which contains two parts with controllers, the data returns from json file. The first conroller for showing the menu, the second - for adding a ...
1
vote
1answer
37 views
AngularJS not putting an array in scope?
So I'm attempting to use Angular JS and the angularSoundManager module to create a music player. I can get songs and the player to work fine, but when I tried changing the main array to be albums with ...
6
votes
2answers
3k views
Angularjs with redux
I have been reading some on Redux. Most of what I read is combining redux with react. I use Angularjs. Is there a good reason to use Redux vs just managing state within angularjs scope and allowing ...
0
votes
2answers
5k views
Get data-attribute value with angular
I'm trying to get the value of a data-attributes element in angular. I have my controller like this:
controller code:
(function() {
'use strict';
var app = angular.module('myApp');
app....
38
votes
7answers
113k views
AngularJS - get element attributes values
How do you get an element attribute value?
e.g.
HTML element:
<button data-id="345" ng-click="doStuff($element.target)">Button</button>
JS:
function doStuff(item){
angular....
8
votes
3answers
133 views
How To Update Page After Calling $http.put service in Directive Using AngularJS/Web API/Angular-ui-router
We are new to AngularJS but are working on an AngularJS/Web API application that updates a data model from an AngularJS Bootstrap popover/directive.
We've successfully updated the database from the ...
0
votes
1answer
28 views
How inform ChildController inside ParentController in Angularjs
I have a code similar to the code below:
<div ng-controller="ParentController">
<button>A</button>
<button>B</button>
<button>C</button>
&...
1
vote
1answer
57 views
Loading map to ngSwitch child scope using ElementRef in Ionic
I'm trying to access a ngSwitchCase view using @ViewChild and ElementRef to load a google map in my Ionic 3 app. I understand the ngSwitch creates its own scope but is it not accessible in anyway so I ...
-2
votes
0answers
48 views
MUlti select cascading dropdown list in angular in asp.net MVC
<div ng-dropdown-multiselect="" extra-settings="dropdownSetting"
options="Categories" selected-model="CategoriesSelected" checkboxes="true" ></div>
<div ng-...
1
vote
1answer
42 views
Angular checkbox loading as ng-checked='true' on ng-change not seeing the change to false
Im having an issue with my ng-repeat checkboxes.
On modal load their status is set from the $http.get
They load fine. but if they are set to true on load when clicked on the ng-change dosent seem to ...
0
votes
1answer
783 views
French accent display in Angular
I have a variable defined in my services.js file and made available to my controller via a factory. This variable contains French accents. Here is an example:
angular.module('starter.services', [])
....
3
votes
2answers
10k views
AngularJS - Check if selected date is equal to next business date
I am trying to check if selected date is equal to next business date using AngularJS. If selected date is not equal to the next business date, a warning will be shown, like twitter bootstrap's alert-...
0
votes
0answers
20 views
AngularJS two way binding between controller, directive, and service
I have a table that can be sorted by column. I've made a directive for each header item that allows a user to click on the header to sort by that column. Additionally, the an arrow is displayed on ...
0
votes
1answer
10 views
using a modal to invoke a function from the parent scope (angular)
I have a main.controller.js and within that controller, i have a modal that i want to use to notify the user of a warning before continuing to the rest of the application.
so for example...i want to ...
-1
votes
1answer
21 views
How to preserve the old values of a form after changing the view in AngularJS
I have some input fields like radio buttons, text box, dropdown, text fields which is filled up by user and on click of a button a new view page opens. Now on back button press I want to show those ...
0
votes
1answer
26 views
how to push correct time from input textbox in angularjs
i want to push time in my database but when i push time my $scope.moreadditems variable its save wrong time please help me i am using angularjs
check when i enter time 9:00 AM why this show ...
0
votes
2answers
36 views
why JSON.stringify change time when i parse json into it
why when i convert time JSON.stringify why my time change please help me how to handle this please anyone help me , and how to direct json transfer Code behind C# variable
subject_end: Thu Jan 01 ...