Tagged Questions
0
votes
0answers
12 views
How do I maintain scope when delegating to service?
I've built a small service to handle errorMessages in my application. Its publicly available on the rootScope and is able to add new messages to my page as needed. Now the need to have clickable links ...
1
vote
1answer
25 views
How to inherit from base controller using “controller as” syntax?
Here is a snippet demonstrating how to inherit from a base controller using $controller and $scope:
var app = angular.module('app', []);
app.controller('MainCtrl', function($scope, ...
0
votes
1answer
16 views
angularjs controller not executing sequentially when using asynchronous service
I'm having trouble figuring out a way to use local variables in a controller that contains an asynchronous call. Is there a way to force the controller to run [at least some of] the code sequentially?
...
0
votes
1answer
19 views
angularjs <timer /> won't update
I have this angularjs controller
angular.module('dashboardApp', ['timer']);
function timingController($scope) {
$scope.timerRunning = false;
$scope.startTimer = function () {
...
1
vote
1answer
19 views
Creating Checkbox functionality using Bootstrap Glyphicons
I have built a great set of bootstrap icons that act like radio buttons. I need to do the same thing bug with checkbox behavior allowing multiple options to be selected and stored. I can't seem to ...
0
votes
2answers
29 views
AngularJS: Bind angular service property to scope
Scenario
I have a service UserService that maintains the (boolean) sessionStatus of the user.
The view conditionally shows [LOGOUT] on ng-show=sessionStatus (i.e. if not logged in (false), no show). ...
0
votes
3answers
36 views
angularjs - copy specific properties from one object to another
I have a controller like this:
CheckoutController = function() {
$scope.Profile = {
firstname : 'Ruchir',
middlename : 'Shakun',
lastname : 'Gupta',
email : ...
1
vote
1answer
23 views
Can I combine isolated scope and inherited scope?
is it possible to combine isolated scope and inherited scope?
I have the following structure:
<my-parent-directive>
<my-directive ng-repeat="foo in foos" ...
-1
votes
3answers
28 views
Angular - Filter to remove blank strings from array
I have an object of arrays... The array can contain blanks, how can i create an ANgular filter to remove the blanks to determine the length of the array?
$scope.myData = {
["1", "1", "4", "4", ...
0
votes
1answer
23 views
AngularJS - ng-switch in directive ignoring numeric values
I have a set of repeated ng-switch statements that i am trying to create a directive for.
HTML:
<td ng-repeat="status in myStatus">
<span ng-switch="status">
<span ...
0
votes
2answers
41 views
AngularJS - Using a directive to produce a <td> not working
I have a large set of repeated HTML for which i am trying to create a directive for. I have created directives in the past, mainly on DIV's, but this is the first time trying on a <table> / ...
1
vote
1answer
37 views
Navigate between states with <a> </a> tag on click
How to navigate between states defined by $stateProvider on click of <a> </a> tag
Here's is my state..
$stateProvider
//region page States
.state('page1', {
url: ...
-1
votes
0answers
11 views
Angularjs - Website is redirecting to login Page After submit request made through IE
I am developing an website using Angular JS. In the website, I am submitting an API request to server and after that reloading the same page using location.reload(). But it is redirecting to login ...
0
votes
1answer
12 views
how to write separate error method while calling calling webservice?
I am calling webservice in factory method .I am getting call back in same method .Mean If I got success it call same method . when it come error it call same method .I need to write separated method ...
0
votes
2answers
32 views
Get the template element in AngularJS directive
I am using AngularJS and I want to create a button that does an action only if the user is registered. If the user is not registered, it opens a signup tooltip with a specific message. Here is the ...
0
votes
2answers
41 views
how to hide table after select of row in angular js?
I make a auto suggest using filter .It show when user type on input field .But when user select any row of table I need to hide that table .In my my case I am not able to hide the table can you please ...
0
votes
0answers
29 views
how to set code on input text field in angular js?
I make a auto complete .First I download my data from server and then write anything on text field it filter with my stationCode.I have two thing in my json array stationCode and stationName array ...
0
votes
1answer
20 views
how to hide and show list in angular js
I make a demo of filter.It is working fine.Now I need to make autocomplete with same code or logic .My list is display whole time when I run the project.I need to show list when user enter text in ...
0
votes
2answers
17 views
AngularJS - combining form fields
I am trying to create a dynamic form where I can enter a duration in hh:mm:ss format.
I would like to store that value as seconds.
I don't see an angular input type that allows for a duration style ...
0
votes
1answer
22 views
Updating scope inside directive and preventing Error: [$rootScope:inprog]
I'm trying to change scope data inside directive and I'm getting thi Error: [$rootScope:inprog] $digest already in progress.
I tried with $timeout but it did not help.
I'm iterating through ...
2
votes
1answer
47 views
Angular “controller as syntax”, passing variables, and isolate scoping
I was just doing this tutorial which makes a lot of sense - http://onehungrymind.com/angularjs-sticky-notes-pt-2-isolated-scope/. A fiddle provided is here: http://jsfiddle.net/simpulton/SPMfT/
It ...
1
vote
2answers
43 views
How an angular object gets the value of another object
How can I make the object inherit all the properties from the other object.
This is the code:
this.makeReady = function(order) {
var tempOrder = angular.copy(order);
tempOrder.status = 1;
...
0
votes
1answer
22 views
Assign value to the Factory variable through http
I have two controllers and one Factory. I am using angular-devise module for authentication.
UserFactory.js
myApp.factory('Userfactory', function(Auth,$location){
var Userfactory = {}
...
0
votes
1answer
38 views
Edit ng-repeated item using ngclick
Im learning Angular and am trying to build bits and bobs to learn. Ive tried to explain myself as clear as possible below - any help will be much appreciated.
Example:
...
0
votes
1answer
16 views
Submit multiple form values with AngularFire
I try to understand how AngularFire works. I'm trying to save a first name and a last name to my firebase database. I successfully created a "first name" input and saved it in Firebase. I now try to ...
2
votes
2answers
41 views
Checking size of an array
I have an array that always returns 20 items. However, if fewer than 20 items are returned, a " " is returned rather than reducing the number in the array.
For example, myArray with 20 items (only 15 ...
0
votes
1answer
18 views
Coalesce / defer multiple child scope $apply calls
In my app I am receiving data via an HTTP channel that's handled in a custom way. I'm building some [data] objects from the pipe, wrap them in a scope.$new(true) and when I receive an update call ...
0
votes
3answers
33 views
AngularJS - Basic ng-repeat with ng-switch
I have a simple ng-repeat, that displays a list of statuses. I wanted to extend this ng-repeat to ng-switch to display a value depending on the status.
Current ng-repeat:
<td ng-repeat="myStatus ...
0
votes
1answer
13 views
Can 1 html calls 2 different controller from 2 different external javascript?
I have my html..
<body ng-app="BuyBye">
<div id='welcomeBanner' ng-controller="1stController">
</div>
<div id="inputCtrl" ng-controller="2ndController">
</div>
...
0
votes
2answers
22 views
AngularJS $scope variable on window onclick
I have a button which when clicked displays a windows and hides it when the button is clicked again.I want the window to close even if any other place in the page is clicked.
This is my code :
<a ...
0
votes
2answers
22 views
Using $watch for two variables angularjs
I have a pop up screen in which a user require to select from two drop down lists.
After the selections were completed i return the selections to the service and save them in an object.
...
0
votes
0answers
37 views
possible attributes/elements inside anchor tag?
What are the types of directives/elements that can be given inside anchor tag .. while using ANGULAR JS?
<a href="" ng-click=""..>{{value}} </a>
and also I want to get the 'value' ...
0
votes
1answer
32 views
What's the difference between using function and using inline expression to set scope variable
I found some differences between executing function and using expression to set variable, specifically, it seems that ng-if fails to detect the changes made by expression. I don't understand why.
...
0
votes
0answers
21 views
angular, trying to initialize values and realize better Angular karma :)
Check out this fiddle, trying to initialize the Login email, it's not and the javascript alert is not called, what am I missing?
<script>
var theApp = angular.module('theApp',[]);
...
0
votes
2answers
18 views
How to access AngularJS Directive attributes when inside & outside an ng-repeat?
Have the following attribute directive.
angular.module('app.directives.auctionItemCard', [])
.directive('auctionItemCard', function() {
return {
restict: 'A',
...
0
votes
1answer
34 views
Changing attributes of enclosing containers based on current view
This is rather a conceptual than a strictly technical question.
I have the following index.html:
<div class="container"><div ng-view=""></div></div>
In my app.js, I have ...
0
votes
2answers
38 views
Angular model not updating when being replaced
This Plunkr demonstrates what I'm having an issue with.
I have an array that's presented both in a dialog and in it's parent page. Modifying that array within the scope of the dialog works just ...
2
votes
1answer
30 views
Angular scope, scope?
I'm learning Angular and was just explaining to a colleague about controllers when they asked why $scope was passed in twice
['$scope', function($scope) {
Can anyone enlighten us?
...
0
votes
0answers
19 views
Angular JS - fill week data into table
I am having a table with nine columns, first column is task, seven columns for week days and last column is for total. First column will be filled with the some task from database, Week columns will ...
1
vote
1answer
26 views
Notifying angular of change
I'm trying to make angular refresh itself as soon as the data model has changed. I have data store object is a rather complex model but in the end should provide angular with the data it has to render ...
2
votes
1answer
39 views
Best practice in keeping `$watch` functions away from your controllers
I tried to find some good examples on best practice in moving $watch functions from a controller to a factory, for example.
What I have found is that actually there isn't a unanimous opinion on ...
0
votes
1answer
7 views
Angular JS change directive scope from transclude
How can I change directive variable (which is in directive controller) from another controller which is in transclude ?
0
votes
1answer
7 views
Is there a good way to ensure that the changes to Scope variables that occur by two-way binding are reflected in the corresponding service variable?
Consider the code:
app.service('myService', function() {
var _name = '';
this.getName = function() {
return _name;
}
this.setName = function(name) {
_name = name;
...
0
votes
2answers
31 views
Recursive call of directive crashing the browser tab
I have an observation directive which render observation.html
observation.js
angular.module('bahmni.clinical')
.directive('observation', function () {
var controller = function ($scope) {
...
0
votes
1answer
28 views
Textarea does not work in Angular but Input works fine
I am trying to create a directive for text area, where I can show the number of characters remaining and clear the whole text area, I don't know why it does not work for textarea, but it works fine ...
0
votes
1answer
32 views
Loading controller on demand using AngularJS and RequireJS
I'm using Angular UI-router and trying to download/load controller when the routing changes. I used resolve and category, the data.data returns the js file content as string. I'm not sure to make the ...
1
vote
1answer
24 views
angular directive not listening to changes in outer scope
I'm currently trying to get my directive to listen to changes happening to a specific variable in the parent scope. For that purpose I came up with the following code which runs fine the first time ...
-2
votes
2answers
29 views
“Object doesn't support property or method 'push'” [duplicate]
I'm trying to add new value into existing JSON object in AngularJS but I'm getting this error message:
"Object doesn't support property or method 'push'"
Here is my code:
$scope.addStatus = ...
0
votes
0answers
11 views
Angular computed observable on child object
Im trying to make a small test with angular but got some problems I cant get it to work
How do I make an observable in a child object in angular?
The problem with this code is that when I load a saved ...
3
votes
3answers
71 views
How should I reference services in my controller functions without using scope?
After reading several articles on avoiding scope soup and referencing the Google Guidelines for building controllers I have been left with one burning question. How should I reference my injected
...