Tagged Questions
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
AngularJS data-binding not working when input field is updated by third-party libraries
This is a form using jquery.placepicker for getting adresses from a google map
and a ng-bs3-datepicker to set the date. but i found that these data are not updated in the controller's scope. how can i ...
0
votes
0answers
9 views
Getting an id is acting strange using AngularJS
I am new to an AngularJS. We have projects and one project can have multiple data layers. When click on copy project should let you to enter a new project name and when click on create should create ...
0
votes
0answers
14 views
Bootstrap select picker with ng-repeat is not working for JSON object
I was using Bootstrap select for search and multiple select but the problem is when i am using $scope object in ng-repeat for options it's not working . I have given my codes below .
<select name="...
0
votes
3answers
22 views
AngularJS: How to bind ng-model to an 2 dimensional array
I am newbie in AngularJs.
I would like to create multidimensional array element in ng-model as defined below.
<Ojbect>
<Array>
<Element1>
<var1>
...
0
votes
2answers
31 views
ng-change is not working after one selection
I have already read this solution where @ryeballar gives the answer to the problem as that the scope of ng-repeat and controller are clashing so using either $parent/controller as syntax will solve ...
0
votes
3answers
23 views
Angular - changes to directive controller's scope aren't reflected in view
Changes to my scope variable foo are getting updated in the html. When that value is change inside the scope of a directive's controller, it isn't updating in the html.
What do I need to do to make ...
0
votes
3answers
32 views
angularjs not updating model value
In my example I want to update model when user focus the textfield. In short append 'px' string to the existing value.
HTML:
<div ng-app>
<div ng-controller="PixelCtrl">
<div>
...
1
vote
1answer
28 views
Unable to show JSON data injected using service inside the amchart directive dataprovider
I am using amcharts as a custom directive. Now I want to fetch the dataProvider of this AmChart from the output of the $http.get service using webservices.
But I am unable to get this dynamically ...
3
votes
3answers
54 views
Image upload using rest api in Angularjs
I have to upload image using rest api for successfull upload will get the response of file folder destination ex: D:/ddd/download,I am not able to upload image, below is my code given suggest me any ...
0
votes
0answers
22 views
Accessing data in a directive
I'm trying to access a JSON object and return it as a list.
This is from my controller.js
$scope.loadClients = function() {
dataFactory.getClientData()
.then(function (response){
...
1
vote
2answers
31 views
Isolated Scope not working
Here is my custom directive code
(function () {
var app = angular.module('CustDirMod', []);
var custdirCtrl = function ($scope) {
$scope.Person = {
Name: 'Jagan868',
...
0
votes
1answer
26 views
AngularJS : Injecting Service in app.run
I want to initialize a globle variable "$rootScope.SegmentSelectedGlobal" at the starting of application only.
This globle variable get data from a service.
If i execute service through controller, ...
0
votes
1answer
36 views
Is it better to use 2 controllers for the same page's two parts
I have one page which has two parts, both parts are somewhere dependent on each other. So my question is Do I need to create 2 different controllers for that.(if yes then how i will share the $scope ...
1
vote
2answers
43 views
AngularJS using same controller for multiple views in single state
I am using angular 1.5 and UI route.
Due to structure limitation we are loading under single state both filters view and content view(mostly for dataset presentation).
I'm trying to achieve single-...
0
votes
0answers
59 views
AngularJs - Make use of Object in top level controller
I have several controllers with my AngularJS application.
Main Controller
// --- Top Level Controller ---
(function () {
'use strict';
angular
.module('shop')
.constant("getDataUrl", "../...
0
votes
3answers
49 views
$scope is acting global
I'm trying to learn directives and I have a bunch of directives that look like my code below. But for some reason, if every directive I define has a "$scope.data" or a "$scope.takeInClick", it seems ...
0
votes
2answers
17 views
AngularJS filter data based on JSON records
I have a JSON file and want to print <divs> based upon address of resturants but I want to group them based upon the 'r.Address' field. Like all records with 'Address' Delhi should show first ...
0
votes
1answer
25 views
My ui not getting updated after updating list in the js file
<td rowspan="5" colspan="2">
<div id="style-2" class="scrollit">
<table class="table-borderless table-condensed" style="height:100px; width:100%; overflow-y:scroll">
...
1
vote
1answer
12 views
Setting up input to update scope variables doesnt seem to work
I have a controller:
.controller("myController", function($scope){
$scope.name = "Test";
$scope.desc = "Hello World!";
$scope.create = function(){
var test = {name: $scope.name, desc: $...
0
votes
1answer
23 views
How to update a field binding using a $watch when using ControllerAs
Within my angular app I have set view using ui-router:
.state('search',
{
url: '/',
views: {
'navigation': {
...
0
votes
3answers
41 views
Two attribute directives with new/isolated scope on single element
I'd like to use an AngularJS directive to disable specific parts of forms throughout the application based on whether the user has a specific role (given as attribute value; may be different per ...
0
votes
0answers
14 views
Ion-view gets title and ion-nav-buttons of previous view
The issue
I have a single <ion-view>, the roles view, that is not getting it's title set correctly or <ion-nav-buttons side="right> updated.
Instead it always picks up the title and ...
1
vote
1answer
25 views
How to run a function attached to an angular controller just once in a binding
I attached a function to the scope, and i wanted to run it in a binding, like this:
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
var count = 0;
$scope.f = function () {
...
1
vote
1answer
19 views
Firing event from dynamically opened controller to parent controller in Angular js
I am developing an Web Application using Angular JS. Frankly, I am new to Angular JS. in my app I am using bootstrap.ui js for angular js. But I am having a problem with bootstrap modal controller. I ...
0
votes
2answers
26 views
Parsing parameters onclick for angularjs app
I am working on enhancing a feature of an already deployed application. All the js code is minified and i only can excess html files. I need to call a function on-click of a 'div' which parse some ...
1
vote
0answers
34 views
ng-repeat=“todo in todods” How do I access 'todo' outside of ng-repeat?
I can only access the clicked 'todo' within ng-repeat. In order to access it else where, for example within the col-sm-8 div, I have to pass it into my controller. Once I pass it in my controller, I ...
-1
votes
1answer
24 views
How to inherit functions from a parent component in angular2
I am new to angular2, feel free to help me tune my vocabulary / terminology
I have a class that is composed of two directives like so:
in parent.component.ts, the Parent is made up of Foo and Bar
@...
0
votes
1answer
15 views
Pass Data to Service from Controller AFTER receiving info from Server
I need to pass data to an array in service after getting from server. The controller runs the function to retrieve data as shown
.controller("messagesController", function($scope, $stateParams, ...
0
votes
1answer
26 views
Toggling accordion classes use angular js
I have created a custom Angular accordion menu. I have the basics working the menus open and close. One issue i am having when I click on toggle menu two i want the added class on toggle menu one to ...
1
vote
2answers
42 views
Ng-if wont render ng-repeat on the screen
I am taking a numerical input from user. I'm asking how many number of people do you want? Lets assume the user entered 3.
Each "people" have a firstname and a lastname.
As soon as the user enters ...
0
votes
0answers
35 views
How to fix angular bootstrap error
My project is non-angular and is using jquery. I am calling a html dialog which loads angular code. Since the dialog is dynamically loaded (in my project using ajax) I need to bootstrap at the end to ...
0
votes
3answers
43 views
Get the index of the click element
I am trying to get the index of the clicked element but I keep getting -1 in the console. I am using Array.prototype to get the indexOf from the nodelist
HTML:
<div ng-app='app' ng-controller='...
0
votes
2answers
28 views
Map not showing first time I enter in the screen
The following html code loads a google map:
<div> Map :
<div ng-controller = "CreateNewEvent" id="map" style="width: 100%; height: 400px" data-tap-disabled="true" ng-init="initMap()">...
1
vote
0answers
25 views
how to use $compile in angular component angular 1.5 and above
I am migrating from directive to component but error is getting while using $compile As :
$compile(ReturnDomElement)(scope);
What should be used instead Of $scope As I dont injected $scope in my ...
0
votes
1answer
23 views
Set $scope variable inside Angular Service
I have this Service in AngularJS:
this.getProductsSiteService = function(idSite)
{
return $http.get(BASE_URL + 'obtener/productos/sitio/'+idSite);
}
It works fine. I use the method below for ...
0
votes
0answers
11 views
Angular Drag&Drop transclusion
I have a specific problem with two sibling-directives which are under one Controller:
I want to drag the copy of a chip and not the original, so I have to copy the element on the dragstart event. It ...
0
votes
0answers
29 views
Understanding $$watchers in Angularjs
What is $$watchers?
Angular keep watch on data with directives(most) and {{}}.
a. How does it behaves in case of expression/filter/regular_data?
b. On what watch is kept on(in case of expression/...
0
votes
0answers
22 views
Programmatical variable change in directive does not run parent scope validation
I have a form that comprises a circle in a map. The "circle picker" is implemented as a directive that renders a GoogleMaps map and updates a two-way bound object (with '=' in directive scope) from ...
0
votes
1answer
32 views
How to put the heading as the first binding and content below that while heading alone have mark
<li class="checked-list" ng-repeat="detail in ctrl.details">Your details are <strong ng-bind="detail.Id"></strong>.
<br/>
<span ng-bind="detail.description"></...
1
vote
1answer
17 views
Adding configuration file to Angular 1 how should the file be structured in order to use it
I have been wanting to have a central place for a configuration file with angular 1.5.8 that I can use for switching from JSON file to localhost to dev server and various other things.
I noticed $...
1
vote
1answer
40 views
AngularJS: Update all objects in $scope simultaneously
Say I have an object stored in $scope like so:
$scope.todo = [
{
"title" : "Groceries",
"todoItems" : [
{
"title" : "Milk",
"status" : "Not Done"
},
{
...
0
votes
2answers
42 views
Angular directive scope value [duplicate]
<tab page="book"> </tab>
<tab page="dial"> </tab>
<tab page="groupe"> </tab>
<tab page="log"> </tab>
<tab page="star"> </tab>
As ...
0
votes
0answers
37 views
Two way binding in angularjs directive with dynamic templateURL
This is the directive code:
App.directive('postTemplate', function () {
return {
link: function (scope, element, attrs, model) {
//console.log("doing nothing");
},
...
0
votes
2answers
51 views
Angular ng-repeat to print array values in a HTML table
I have an array in my app.js file, contents of which I would like to print sequentially in rows in my HTML table.
Below is my app.js file:
(function () {
var app = angular.module('TravelI', []);
...
1
vote
1answer
24 views
Picture won't display as part of my little angularjs app
I wrote a little app that converts Fahrenheit to Celsius and I want a picture to display based on the Fahrenheit temperature. I can't get the picture to display. Can someone tell me where I'm going ...
0
votes
1answer
46 views
passing data through Angular custom directive
I created a custom directive in angular. I would like to pass parent data through the directive using scope but I'm getting 'undefined' when I log scope and scope.questionId.
HTML
<a class="...
0
votes
1answer
29 views
Retrieving model values from dynamically opened controller's scope in Angular js
I am developing an Web Application using Angular JS. Frankly, I am newbie to Angular JS. Very new. In my app, I need to dynamically add and remove elements. I use directive for it. Adding and removing ...
1
vote
1answer
36 views
Not able to display the object array values in the dynamically inserted view using angular Js
I have just started to learn AngularJS.
I am trying to write this code with 3 files index.html and view1.html and view2.html . In index.html I have defined the module and controller function.In the ...
0
votes
0answers
39 views
Handling Json response dynamically in angularjs
Json:
{
"json": {
"response": {
"servicetype": "1",
"functiontype": "10011",
"statuscode": "0",
"statusmessage": "Success",
"data":{
"roleid": 36,
...
1
vote
2answers
64 views
$compile not updating dynamically generated html runtime
Here is jsfiddle:
https://jsfiddle.net/vikramkute/eq3zpmp9/5/
I am new to angular. I have an object which needs to be appended runtime in html. I am using angular 1.2.25
Expected output is
1 ...