Tagged Questions
0
votes
0answers
5 views
Grunt connect-modrewrite do not work
I used generator-angular for create my project.
I use HTML5 History. ($locationProvider.html5Mode(true).hashPrefix('!');)
For url rewrite I use connect-modrewrite
I did all like described in ...
0
votes
0answers
26 views
Angular directive doesn't fire change event in ngModel
I created a directive for input elements which creates a custom select2 dropdown.
After selecting an element, the original input field (which is used to filter data via the ngModel) is filled with the ...
1
vote
2answers
34 views
How to bind an AngularJS controller to dynamically added HTML?
For this scenario, I have a page of HTML with some AngularJS directives, controllers, etc.
Something like this:
<html>
<body>
<div ng-controller="myCtrl">
<ul><li ...
0
votes
0answers
9 views
Angular-UI-Router - change 3rd level nested view without knowing about 2nd level nested view
I have few "parent modules", lets say
user
community
I also have "embedable modules", lets say
photos
videos
wiki
My embedable modules can be embed to the parent modules.
All modules do not ...
1
vote
1answer
13 views
java substitute for angularJs watch
To understand this question one must know the $watch module of Angular.
My requirement is to find a substitute of $watch of Angular in Java. I have hash table which has over 1000 values. Now every ...
3
votes
2answers
32 views
AngularJS input ng-model not updating
I am trying to create a simple pagination directive with an isolated scope. For some reason when I manually change the value it gets a bit finnicky. Here is my problem:
When I page forward and ...
0
votes
2answers
24 views
add ng-click to a div that was added using ng-bind-html
I have a div that is created in javascript using angularjs. Here it is
Js:
$scope.myHTML=$sce.trustAsHtml('<div
ng-app="mainModule"
ng-controller="mainCtrl"
ng-click="updateText()"
...
0
votes
1answer
26 views
Is it better convention to make angularjs directives “attributes” or “elements”
When making angular directives, it seems there are a set directives that could just as reasonably be defined as an HTML element, or an attribute. I am trying to figure out what the community ...
0
votes
1answer
20 views
Angular json data in service across controllers
Hey guys i'm new to angular and am not very proficient with javascript. This setup pulls in the json data fine, however when I make changes to some of the properties in the object, they reset when I ...
0
votes
1answer
49 views
Associating arrays with javascript variables
I have a html file that uses binding to present a structure that i define in my web api and receive it with angularjs resource.
To present that info i'm writing like this
{{phones.List[0].Values}}
...
0
votes
1answer
29 views
AngularJS v1.2.5 script error with textarea and placeholder attribute using IE11
I have an Angular JS v1.2.5 form that won't work in IE11. It works fine in Firefox, Chrome, Safari. My form uses a textarea with interpolation inside the placeholder attribute.
<body ...
0
votes
0answers
8 views
Angular ui typeahead from an array of objects - how to get the select value
I'm using typeahead angular bootstrap which is a very neat directive, but I'm encountering a difficulty to get the select value when using it with an array of objects (needed for a custom template ). ...
0
votes
0answers
20 views
AngularJS: Injecting service into a HTTP interceptor (Circular dependency)
I'm trying to write a HTTP interceptor for my AngularJS app to handle authentication.
This code works, but I'm concerned about manually injecting a service since I thought Angular is supposed to ...
1
vote
1answer
21 views
How do I loop inside of a view when displaying records fetched with AngularJS?
I'm starting to learn AngularJS. I'm experienced with JavaScript/jQuery but I'm having some difficulty right now understanding the basics of AngularJS. I have a quick question for anyone with the ...
0
votes
2answers
35 views
How can I add a listener to an Angular directive?
I have a directive that builds a Google chart. I would like to trigger an event handler on my controller's scope when the directive receives an event from the chart.
Sample: ...
0
votes
2answers
20 views
changing text on button while saving using angularjs
How do I change the text on a submit-button while saving data in a form ?
I have a button like this
<button ng-click="save()">Save data</button>
and I updated my save-function based on ...
0
votes
2answers
24 views
How can I get the full url of the current ui-router state?
I'm using ui-router for AngularJS; I'm handling the '$stateChangeSuccess' event, and trying to get the full path (after '#') for the current state. $location.hash() returns an empty string and ...
0
votes
0answers
52 views
Execute another function after finishing one function
This may be a silly question, till now I am using something along the lines of.
$scope.selectEvent = function ($index, event, callback) {
// Do stuff
setTimeout(function() {
...
0
votes
2answers
39 views
How do I detect if an object has been added using angular.forEach AngularJS
I am trying to add objects to $scope.orderitems and if the object is already in the $scope.orderitems I want to change the quantity property of the object using angular.forEach instead of adding ...
0
votes
3answers
34 views
Callback and AngularJS (ng-click)
I have a a button like
<div class="button" ng-repeat="event in events"
ng-click="selectEvent($index, event, generate)">
Content
</div>
In which generate is supposed to be the ...
0
votes
1answer
38 views
Transcluding an ng-model
I am trying to write a "read-only" directive that will transform an input (with ng-model) to a span that has the value of that model. I would like to do this by simply adding "my-read-only" attribute ...
1
vote
1answer
49 views
How do I tell Grunt to NOT minify or concatenate js files in a build task?
I've just scaffolded an Angular app using Yeoman. I've noticed that the build task does several things by default, including minifying and concatenating js files, compiling .scss into .css, cdn-ifying ...
0
votes
1answer
35 views
Directive and more
I have developed a web application using Angular.js (It's my first). The application features a collection of interactive graphics (seat maps); so I created a module to handle the Raphael stuff, ...
0
votes
2answers
51 views
$http promise in angular service
I am having a problem with promises in an angular service. I have a service with a method getArea which is supposed to return the name of a service-area. The service gets the service-areas from the ...
0
votes
2answers
21 views
Load Image Data into Angularjs
I have a bunch of image urls and I want to download the images from the browser into a zip file. I'm planning on using jszip to create the zip file. And I have all the image urls from the server. ...
2
votes
2answers
34 views
How to get ng-repeat radio-button value inside the controller?
I have a form, within there are different input-tags and labels :
form action="">
<div class="fields" data-ng-repeat="option in question.body.options">
<input ...
0
votes
1answer
19 views
What is the correct way to forward ng-model to an element inside your directive?
So I have a directive that uses the compile function to replace the element. The template that replaces the element has an input which I want to apply ng-model to. The ng-model attribute should be ...
0
votes
0answers
19 views
How to achieve offcanvas menu with angularJS?
I'm trying to implement offcanvas menu inside my angular app.
I use angular 1.2. The animation work smoothly but there is one little détail (ans you know, devil lies in the details)
During the ...
6
votes
1answer
59 views
When Angular directive's name really matters
I've just come across a strange behavior from Angular:
Here's the scenario:
In a registration form, I want to check for email uniqueness (through an http call to server).
Thus, I created a directive ...
0
votes
2answers
23 views
JSON populated form elements not filtering using angularJs filter
The Select element does get populated by the http request, but the options in the select element are not updating as the ng-model is changed. I am new to angularJs so im assuming its a simple fix. I ...
0
votes
1answer
26 views
How do I get a promise from a compile in AngularJS?
There's an event that needs to be triggered after a compilation is finished.
This is what my parent controller looks like:
myApp.directive("ParentDirective", ["$rootScope", "$compile",
...
0
votes
1answer
27 views
Angularjs - Split String issue
I am temporarily devoid of seeing eyes.. The code below throws up an error
Error: value.split is not a function
Is threre an angularjs way of splitting a simple string
var value = "7,9";
...
1
vote
2answers
26 views
Socket.IO and AngularJS creates multiple connections, how to stop?
I'm developing a realtime socket.io app using AngularJS, Nodejs, and Socket.io both the server and client side libraries. I'm using the module called angular-socket-io however when I tell Angular to ...
1
vote
2answers
23 views
Binding a single angular expression out of a json-file
I am pretty new to angularJS, and obviously there are some simple things that i do not yet understand. What i want to do is the following:
I've got a de-DE.json (that e.g. has several language-keys ...
2
votes
3answers
34 views
ng-animate when ng-view is updated through route
I try to animate the change of a ng-view div in AngularJS.
So my div inside my index.html file looks like:
<div ng-view></div>
I have another html-file (view1.html) with just divs ...
0
votes
0answers
15 views
Cannot read the data posted to Laravel using Angular.js http method
I am not sure wether there is a serious problem or I am doing it wrong. I am using Laravel4 and Angularjs V1.2.5.
My code is simple and looks as follows:
Controller function:
public function ...
1
vote
1answer
36 views
Update ng-model data with inputs
I'm new in angular and I have a problem.
I want get promise data from DB and show it by input.
This is my input:
// not editable
<input type="text" ng-model="currentMedCenter.name"/>
...
0
votes
1answer
18 views
Angularjs: passing an object params to state
I'd like to pass an object to a state. Here is how I did it:
.state('options', {
url: "/options?current_task",
views: {
"middle": {
templateUrl: "/games/options.html"
}
...
1
vote
2answers
38 views
Value not passing to directive - AngularJS
The isHidden value is not getting through to my Directive, so my animation isn't working.
I've console.logged everything and it seems to be failing at the attrs.
I'm using angular 1.2.
I'm sure ...
0
votes
0answers
28 views
Get property named post in restangular
I'm getting a list of 'postrows' with the following code
$scope.postrows = {};
Restangular.all('/postrows').getList().then(function(data){
$scope.postrows = data;
});
The JSON which is returned ...
0
votes
1answer
27 views
AngularJS App: How to include .js files into index.html
I'm new to angularJS. I managed to build a phonegap app using angularJS. The app is ok and running just fine. The problem is, now that I have a little more understanding on how angularJS works (at ...
0
votes
0answers
23 views
Angularjs filter search from outside the ng-view [duplicate]
I'm trying to do a full text search on several li.
I've got a:
<input type="text" placeholder="Search..."/ ng-model="query.title">
which is not controlled by any controller nor included in ...
0
votes
1answer
28 views
newValue always equals to oldValue in AngularJS property watching in unit test
I have an controller which is simply watching a 'name' property and prints its new and old values on any change.
function Ctrl($scope) {
$scope.$watch('name', function(newValue, oldValue) {
...
2
votes
1answer
18 views
AngularJS: Pass an object into a state using ui-router
I'd like to be able to transition to a state and a pass an arbitrary object using ui-router.
I'm aware that usually $stateParams is used, but I believe this value is inserted into the URL, and I ...
2
votes
1answer
30 views
AngularJS different ng-app on differnet pages
I am new to Angular JS. I am trying to learn. I have created a project which uses grunt and bower.
This is my project struture
MyApp
|
|__app
|
|__bower_components
|
|__scripts
| |
...
1
vote
2answers
32 views
Angularjs: accessing scope variable array and calculating average
sorry if the question is a little abstract from the title. I will try to explain it here and supply a Gist with relevant code.
I have a JSON api which I grab through AngularJS. This is basically a ...
4
votes
0answers
30 views
Scrolling iframe on mobile app jump to top of the page at some point
I have this html:
<header class="bar-title"> <a class="button-prev" onclick="history.back(-1)">back</a>
<h1 class="title">Page</h1>
</header>
<div ...
0
votes
1answer
34 views
Get leaf node depth from tree view in angularJS
I have a tree view Json object is
{
"Name": "Root",
"Id": "-1",
"ParentId": "null",
"children": [
{
"Name": "Math",
"Id": "1",
"ParentId": "-1",
"children": [
...
0
votes
1answer
37 views
Angular app does not load initial page
In an Angular app that I'm currently developing, the first page call does not cause the correct route template to be loaded (only the menu bar is shown). Only if I click on another link and back to ...
0
votes
1answer
38 views
Angular JS Missing Required Controller error: Controller 'ngModel', required by directive can't be found
I have this directive:
directive('myDirective',
function() {
return {
restrict: 'EA',
scope: {
params: '=ngModel'
},
...