Tagged Questions
1
vote
2answers
16 views
Scope variable is not updated on ng-click in views with Angular UI Router
I have a problem with the following code: Plunkr.
When I click the button, the ng-click changes the variable var1 in scope. But apparently this variable is not updated in view, which I have created ...
0
votes
1answer
14 views
Angular service reset when changing page through Angular routes
I have multi page signUp form , I need to persist data until last step , so that user can jump to any step back and edit.
I am using service "User" as singleton object for all six steps.
...
0
votes
1answer
15 views
Acessing directive's scope within trancluded ng-repeat
I'm writing a component and need to ng-repeat on directive's isolate scope property.
Consider this:
<div some-directive>
<h2>Let's repeat something</h2>
<p ...
0
votes
0answers
7 views
Angular-AutoSave - Error using Fundoo-Solutions Directive
I have this autosave working with a directive but it is not working from within a controller.
It is supposed to save the model on change and then restore when I select restore from the button click. ...
0
votes
1answer
25 views
Angular.js service return $http success data
In my app, I want to create a service that looks in the backend to check if a user is logged in and returns the user data and privileges. My factory service looks like this:
app.factory 'Session', ...
0
votes
1answer
26 views
Is there any way to prioritize the order of controllers/directives being loaded in page in AngularJS?
I have a problem with controller that is being loaded before it has been getting from other directive an id he should have in order to load himself.
How can I organize the order of loading component ...
0
votes
2answers
15 views
AngularJS $location.path same url
I am wanting to reload the page manually, using
$location.path('/account');
correctly moves to a different page however I want to use
$location.path('/account/messages');
while on ...
0
votes
3answers
36 views
ng-model not working Angular js
I am trying to update a parent scope in a nested ng-repeat loop but it doesn't work ! I have literally been on this for the 2 pass hours !
This is my nested loop:
<div ng-repeat="input in config" ...
0
votes
3answers
25 views
How to communicate between controllers while not using SharedService between them?
I was reading all the answers about communication between controllers and directive, but is seems to me occurred using shared service and inject it to each one of them. When I'm developing a very ...
1
vote
0answers
15 views
Does using “controller as” syntax can help to find a scope of a controller in AngularJS?
I read about this new feature, very nice when you have nested controller, help to understand the binding element, where everything is coming from.
But I'm curious if this also can help me to find a ...
0
votes
2answers
34 views
Updating angular $scope variable inside forEach loop
I have a quite extensive filter/faceted search application.
Data are loaded via an API, and then displayed on the page using a ng-repeat. There's also a google map instance which has a marker ...
0
votes
1answer
16 views
My directive stopped working when I started using ng-repeat with a different controller. What am I doing wrong?
So I followed this guide so I could have a nav bar on every page: http://tomaszdziurko.pl/2013/02/twitter-bootstrap-navbar-angularjs-component/
And it was working, until I created a separate ...
1
vote
1answer
21 views
How to filter JSON data based on current date
I wanna ask about angularJS.
I have json here
var friends = [
{
"id":1,
"Tanggal":"\/Date(1408060800000)\/",
"Nama":"Hari Departemen Agama Republik Indonesia"
},
{
"id":2,
...
0
votes
1answer
22 views
How to communicate between directive (tree component) and any other controller or directive in AngularJS app?
First of all, I have read so much info you all share about communication between controllers, that I'm now so confused about the BEST way to do it. I understand I should use service, but don't really ...
0
votes
0answers
35 views
Text box is not getting cleared
I am using Angular.
In my controller I have:
mainApp.controller('loginBoxController', ['$scope', '$state', 'mainWebService', function($scope, $state, mainWebService) {
$scope.usernameText = "";
...
4
votes
2answers
71 views
Use ngModel with plain ngController instead of directive?
In my application I would like to preserve the option of using plain controllers for certain sections of code - as opposed to creating directives for one-off things that will never be re-used.
In ...
0
votes
2answers
28 views
How to change valid HTML tags that get rendered in ng-bind-html?
I have a text editor (textAngular) that I've modified to limit the number of valid HTML tags I can generate using that tool. Now, I want to only support a limited number of HTML elements (h3, h4, h5, ...
1
vote
3answers
67 views
How to get consolidated results from ng-repeat?
See this plunker.
<div ng-repeat="subCategory in subCategorys | filter:{tags:tag}:true | orderBy:'id'">
{{subCategory.id}} {{subCategory.name}} {{subCategory.tags}}
...
0
votes
2answers
43 views
How to use a scope in Directive template
I want to use $scope variable in template function of directive like this.
In the other words i want to generate directive template inside of directive and by using $scope variable.
Help me to ...
0
votes
1answer
48 views
how to get event of on change of drop down in angular?
can you please tell me how to get event of on change of drop down in angular ?.
I make a drop down from json .I need to show alert when user change the drop down ng:change and get it drop down value ? ...
0
votes
1answer
78 views
Accessing AngularJS controller from parent controller via jQuery .each() search
I don't know for sure if this is the correct way to go about calling functions or dealing with child elements, but here is my setup for AngularJS. Also new to stackoverflow sorry if I don't get the ...
0
votes
1answer
26 views
spyOn $scope.$on after $broadcast toHaveBeenCalled fails
I'm having a lot of trouble getting this simple test working.
I've got an $scope.$on listener in a controller that I want to test. I just want to make certain it's called after a broadcast event.
To ...
-4
votes
0answers
19 views
The radio buttons are not getting cleared in angular js
I have a weird problem with radio buttons not working with angularjs
I have two sections of radio button on my page
Section 1
<input type="radio" ng-model="myradio" name="Monish" value="Monish" ...
0
votes
1answer
20 views
how to avoid double encoding with $sce
Angular $sce service seems to be encoding characters and not trusting the html. Is there an option to have the html trusted?
$scope.text = $sce.trustAsHtml('it's broken')
An example.
...
0
votes
2answers
30 views
How do I reference the scope/model property of an element from within an AngularJS directive?
I am using a custom directive to attach the jQuery Chosen plugin to a multi-select element. (I realize there are similar native AngularJS plugins out there, but I want to learn how to integrate a ...
1
vote
2answers
27 views
Submit form on page load in Angular
I would like to submit a search form on page load if search terms where specified in the route. The problem is that searchForm isn't defined yet when search() runs. I've seen others get this to work ...
2
votes
1answer
53 views
Angularjs ng-repeat filter on multiple layers of the JSON
I am trying out angularjs framework.
Have a statistics information in the form of JSON like :
[{"Region": "USA",
"People":[{"Id":2,"Name":"Pals"}, {"Id":1,"Name":"Andrew"}]},
{"Region": "India",
...
0
votes
1answer
15 views
AngularJS a scope variable is not updated in an anonymous callback function in directive
I've been trying to make a cubism.js graph with polled data (every second) from REST API.
It seems like a correct value is passed to the directive, but it is not passed to an anonymous callback ...
0
votes
0answers
35 views
Possible angular scope shadowing unexplained
I have tried several different methods or wrapping a simple jquery-ui slider, the first of which is:
//Slider control
TDApp.directive("tdControlSlider", ["TDSV", function (TDSV) {
return {
...
1
vote
2answers
35 views
What is the correct way to handle AJAX driven DOM changes in Angular.js?
I realize that "the correct way" is subjective but I think this is a specific enough question that there is a best practices approach to it.
I'm new to Angular and trying to understand what the ...
0
votes
1answer
15 views
view not updated when using $http in service
I have an angularJS application with 2 controllers and one service to exchange data between controllers.
Controller 1 "controls" an angluarjs-map an provides the map-metadata for the view.
A ...
0
votes
2answers
35 views
Using object name when AngularJS variable is defined in $scope
Let's say we have an NameController in AngularJS. There you can define variables like this:
this.name = 'Joe';
Or:
$scope.name = 'Joe';
I always like to call all variables using the object ...
-2
votes
2answers
35 views
Use scope variable and dynamic css in ngClass
I would like to use a scope variable and and set css dynamically within html.
<div ng-class="myClassScope, { 'dynamic-class': !ifIsNot }">
0
votes
2answers
21 views
AngularJS - Upgrading v1.2.5 to 1.3 to use bind once
I am trying to improve the performance of my ng-repeat's. I have upgraded my project to use library v1.3.0 (main lib and route).
I am trying to use the bind once as here: Do bindings nested inside of ...
0
votes
0answers
16 views
Inject variable to isolated scope of directive
Is it possible to inject variable from outer scope to isolated scope of directive without explicit definition of attribute?
directive:
scope:
attr: '='
div(directive, attr="var1", ...
0
votes
1answer
16 views
Full Calender not working with angular code
I'm using ashraw's fullcalendar for an event scheduler in my project, and to display the events I have to write the code in jquery like this:
$(document).ready(function() {
...
0
votes
2answers
37 views
AngularJS ng-model value is lost after custom validation directive is triggered
I created a custom validation directive and used it in a form. It can be triggered with no problem, but after the validation is triggered, I found that the model value is just lost. Say I have
...
0
votes
2answers
25 views
How to send user entered value on submitting with minimum validation or required error in angular js
Here we were trying to send the user entered input value to Servlet.
So below is one example, When user entered minimum length for input field then inbuilt angular validation occurs and because of ...
1
vote
1answer
20 views
Passing data to out of scope variables in angularjs
I need a guide for a clarification in angular controller scope.
My app has different controllers in controllers folder. And different pages for each controllers in pages folder. My point is how ...
0
votes
0answers
4 views
How do I clear the jqxinput textbox in angular method?
FYI : I have all my scripts and other necessary files loaded.
In my controller, I have:
mainApp.controller('secureLoginController', ['$scope', '$state', 'mainWebService', function($scope, $state, ...
0
votes
1answer
38 views
+50
angular controller function does not return results from one function to another
in my controller i have a function
$scope.orderHistory = {};
$scope.results = {};
var getHistory = function (max,offset)
{
//do some stuff
$scope.orderHistory = data.entities;
...
0
votes
0answers
25 views
AngularJS - Child controller private scope (preventing inheritance)
I have a case where I need to nest controllers. I do not want the child scope to inherit from the parent scope because I have scope variables with the same names in both controllers. Is there a way to ...
0
votes
1answer
31 views
TypeError: undefined is not a function — Need to troubleshoot
I get this very weird error
TypeError: undefined is not a function
at h.$scope.getCoordDistance (http://run.plnkr.co/NDFxGL6q55m1601d/script.js:32464:21)
at ...
0
votes
2answers
32 views
AngularJS $scope in loops/forEach
I am writing an app that will allow the user to click on a location and be directed to google maps, everything works as it should except: In this app I have a table that I want to be able to be sorted ...
0
votes
1answer
24 views
Scope $destroy event called when initializing new controller
I'm currently working on a project using Angular JS where i need to be able to initialize and destroy controllers and scopes to be able to show different content in the same modal. The problem i have ...
0
votes
2answers
53 views
Angularjs how to access scope data from outside
I have this poller function that polls data every 10000ms which is fine, however I need to be able to access variable from outside so that I can use splice function.
code for service:
'use strict';
...
0
votes
2answers
25 views
AngularJS - Using an external Factory for a $http GET Request - How to return the result properly?
After a few tries, I am now able to access the external service factory (was told it's a good practise to decentralise it) to retrieve product data and display them in my view.
At the moment I am ...
0
votes
1answer
23 views
Angular directive to change parent model, like ng-model
I m learning "directives" and how are useful.
My directive bellow, should increment by one on each click (both $scope.model and scope.bind ), but does not work.
Whats happening? i misunderstood?
...
0
votes
1answer
24 views
Accessing Fetched Resources From a Controller?
In my AngularJS controller I'm trying to do something relatively simple: I'm trying to populate a <select> element dynamically in the controller. To do so I need to wait for my localized UI text ...
0
votes
1answer
27 views
isolated scope / Good way to communicate an array to the directive caller
Let's suppose this custom directive mentioned in myHtml.tpl.html:
<my-directive></my-directive>
This directive is initialized with an isolated scope.
Of course, I have a ...