AngularJS is an open-source JavaScript framework. Its goal is to augment browser-based applications with Model–View–Controller (MVC) capability, reduce the amount of JavaScript needed to make web applications functional. These type of apps are also known as Single-Page Applications
0
votes
1answer
8 views
How to pass values through an AngularJS directive to a function?
I have a directive with an attribute like this in my app.html
<tr ng-repeat="post in posts | filter:searchTerm | limitTo:limit ">
<td>
<span eachpost="{{post.id}}" ...
0
votes
0answers
8 views
AngularJS: sending events from the isolated scope
I want to have a set of reusable widgets which can be used anywhere in the application.
For ex. I want to have a settings menu and the menu items defined as nested custom tags. I want to be able to ...
0
votes
1answer
10 views
AngularJS Scopes and Deferreds
I have a service that does something hard and returns a promise:
.factory('myService', function($q) {
return {
doSomethingHard: function() {
var deferred = $q.defer();
...
0
votes
2answers
18 views
Call a controller function from directive with parameters
How can a directive call a function from a controller with some parameters ?
I would to give the variable myVar to the scope.$apply(attrs.whattodo);
HTML :
<div ng-app="component">
<div ...
2
votes
2answers
38 views
How to get element in angularjs analog of get by id in javascript?
Lets say I have button:
<button type="submit"
value="Send"
id="btnStoreToDB"
class="btn btn-primary start"
ng-click="storeDB()"
...
2
votes
1answer
31 views
Where is the recommended place to use $http.get
I am playing around with angularjs and have the following HTML:-
<div ng-app="App">
<div ng-controller="AppCtrl">
<products></products>
</div>
...
0
votes
1answer
15 views
When using ng-view have scrollTo errors
First time using ng-view with Angular and on a fresh application of angular js with ng-view I am having all these scrollTo errors. How can I fix this? Ive checked StackOverflow and Google and cannot ...
0
votes
0answers
23 views
Restrict number of decimals in html5 type=“number” input field (with Angularjs model)
Please find the fiddle
http://jsfiddle.net/q2SgJ/5/
<div ng-app="">
<div ng-controller="Ctrl">
WANTS: {{val | number:2}} in "input" elelent<br>
2 decimal in input: ...
0
votes
1answer
25 views
Angular.js - Redirection not working
I have somes difficulties to understand the behavior of Angular.js routing
Here is my code
my app.js:
'use strict';
var app = angular.module('myApp', []).
config(['$routeProvider', ...
2
votes
0answers
20 views
Angular - Directives and using Module
After studying various different projects and reading as much documentation as I can handle, I've run into an issue with how to include directives in my app. The app is setup like the following:
...
0
votes
0answers
18 views
How to detect a User vs Script Variable Change in an AngularJS $watch()?
I would like to implement a start and end date on a form, but also allow the user to pick from a bunch of preset date ranges in a drop-down. If the user selects a value from the drop-down, the start ...
1
vote
1answer
13 views
Angularjs - cross controller Factory Update
I have two controllers which shares same factory. One of the controller is updating factory variable. Other should watch for that change and display later.
This is how I tried:
...
0
votes
0answers
9 views
Way to use AngularJS in a magazine reader app
I'm learning AngularJS to make an app like this one.
The example site uses a global JS object for one issue of a magazine to manage pages of it, and uses click handlers to deal w/ page switching and ...
0
votes
1answer
15 views
How to trigger ng-change on a select that contains a ng-repeat
I have two select box, the second select box updates itself when the first select box changes.
<label>Region</label>
<select ng-model="region" ng-change="clear(1)" ...
0
votes
0answers
8 views
Angular + Rails app hang up whole browser when trying to fetch subpage
I'm writing application using Angular and Rails. I have fallback in my ApplicationController:
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter ...
0
votes
1answer
8 views
AngularJs raw template shows briefly on IOS before being replaced
I've a mobile site based on angularJs, on a normal machine it looks fine.
When I take it to IOS. I notice that the raw template is shown briefly before the text is replaced by angularJs.
i.e. i have ...
1
vote
1answer
19 views
AngularJS DOM update for loop progress
I have a number of AJAX calls that need to be run for every entry in an array, I'm trying to supply some visual feedback on the progress of the loop through the array, the model is being updated ...
0
votes
0answers
7 views
select2 widget fails to update the selected value programatically
Working with angular, select2 widget.
I am declaring it in HTML something like this:
<div>
<select id = "dropdown"
...
<option value = "1" id="1">1</option>
...
0
votes
1answer
22 views
Angular Js and Trigger.io - Can't follow a link on Android that works on iOS
I am using AngularJS with Trigger.io to develop a mobile application for both iOS and Android.
When I try to open a link that looks like this:
<a ...
0
votes
0answers
21 views
Is there a way I can return a promise from a $resource without needing to use $q?
I have coded the following service:
angular.module('App')
.factory('TestService', ['$http', '$q', '$resource', function (
$http, $q, $resource) {
var ...
1
vote
1answer
22 views
Angular: call function from the view
Hi I have the next problem:
In my view I call a function prepareDynamicData(itemMenu);
<div ng-repeat="itemMenu in menuDetailsData.categories" class="headDetails fontH2">
<div ...
1
vote
1answer
26 views
What's the best way to “transfer” directives from and to, using AngularJs
I have a widget that has the following structure (it's a "plan selector" resume):
<div>
<ul>
<li resume="to" ng-repeat="item in items"></li>
</ul>
<div ...
0
votes
0answers
28 views
HATEOAS client with AngularJS
I was wondering if there were any features hidden in Angular or exposed by some 3rd-party libraries to easily create HATEOAS-compliant Restful clients.
On backend side, I am using Spring Data/REST to ...
0
votes
1answer
31 views
Trouble with angularjs animations
Module.animation 'slide-down', ($rootScope) ->
console.log 'animationInit'
animation =
setup: () ->
start: (element, done, memo) ->
...
0
votes
1answer
30 views
In AngularJS, jquery append method seems not to be working in directives
I want to implement my own version of ng-repeat. But somehow I cannot get it working since the jquery append method seems not to be working.
script.js:
var app = angular.module("app", []);
...
0
votes
1answer
16 views
AngularJS prevent default select directive
In my case AngularJS's select is not a good fit - (with ng-repeat approach <option> values can only be strings and with ng-options I can't properly set the initial selected value).
What can I ...
1
vote
2answers
47 views
why ng-bind is better than {{}} in angular?
I was in one of the angular presentation and one of the person in the meeting mentioned ng-bind is better than {{}} binding. One of the reason, ng-bind put the variable in the watch list and only when ...
-1
votes
0answers
27 views
Getting the most performance from serving HTML+js in node [closed]
(trying to avoid having this question closed due to lack of objectivity in replies)
I am trying to create an application in angular.js that creates and serves HTML+js as pages (served inside ng-view ...
0
votes
2answers
34 views
Using Inline Templates in Angular
I wanted to load an inline view template.
I wrapped the template in a script tag of type text/ng-template and set the id to temp1.html. and here's what my module config looks like
...
1
vote
1answer
33 views
Shouldn't there be an AngularJS ngWith directive?
Maybe I'm crazy, or too used to KnockoutJS, but I keep looking for an ngWith directive in the docs to define the scope on an element, in a controller, or for an included (ngInclude) partial.
For ...
0
votes
1answer
17 views
Reset form after submission in AngularJS
I'm having trouble resetting form fields after submitting in AngularJS (v1.1.3). Here's a snippet of what I'm trying to do:
HTML
<form name="addMemberForm">
<input name="name" ...
0
votes
1answer
9 views
Array length in angularjs returns undefined
JS:
function UserController($scope, User, Group){
$scope.users = User.query();
$scope.isNewUser = function(){
var len = $scope.users.lenght;
console.log(len); ...
1
vote
0answers
13 views
How to get Select2 tags initializing correctly with Angular UI when option groups are used?
I have been trying to get my angular ui select2 directive to initialize and have been unable to get it to work with option groups.
The Code:
function testCtrl1($scope)
{
$scope.selectedOptions ...
0
votes
0answers
27 views
Effectively mock a global property with Jasmine
My app has dependencies to gapi javascript client (https://apis.google.com/js/api.js) and jsapi (https://www.google.com/jsapi).
I building my app with AngularJS and using Karma (formerly Testacular) ...
0
votes
2answers
28 views
How to get an object that was changed in angularjs?
I use this function to watch an array of objects for changes:
$scope.$watch('Data', function (newVal) { /*...*/ }, true);
How can I get an object in which property has been changed so that I can ...
1
vote
2answers
20 views
Angular.js/jQuery html string parsing in 1.9.1 vs. 1.8.3
Trying to do angular.element(stringWithHtmlStructure); causes
Error: Syntax error, unrecognized expression: <div id="foo">bar</div>
in jquery 1.9.1, however it works in jquery 1.8.3
...
0
votes
1answer
45 views
AngularJS - Custom Directive : Select Control - Filters
I saw a jsfiddle example for a custom select control directive: [http://jsfiddle.net/marco_m_alves/rjbMj/]
myApp.directive('nameValueSelect', function() {
return {
restrict: "E",
...
0
votes
1answer
26 views
Unable to register A Custom angularjs filter
I am trying to write my own filter in angular. But while trying to register the filter I get the error,
Error: No module: customFilterModule
[Break On This Error]
throw Error('No module: ' + ...
3
votes
0answers
18 views
angularjs and ASP.NET MVC : best strategy for clientside models
I'm currently looking into client side model binding to HTML templates especially with angularjs. I was wondering what the best strategy is for retrieving clientside viewmodels from the server, e.g. a ...
4
votes
4answers
61 views
How do I access the child ngModel from a directive?
Like in this question, I want to add .error on a form field's parent .control-group when scope.$invalid is true.
However, hardcoding the form name like in ng-class="{ error: ...
0
votes
1answer
25 views
Writing first angular app. How should I architect this?
I'm writing my first angular app after messing around with some basic todo type apps and am curious at what would be the proper way to architect the controllers from a high level.
The app will allow ...
0
votes
1answer
39 views
Inserting removing elements from the DOM
I have a code that inserts a div with content whenever the user clicks a button. What is the angularjs way to insert or remove elements from the DOM?
0
votes
1answer
43 views
AngularJS - Asynchronous call to Facebook API
I'am trying to call a Facebook API with AngularJS.
The problem is that all calls from FB API is Asynchronous, so I need to know when my query on facebook is avaliable to use in agularjs.
For this, I ...
3
votes
1answer
73 views
Ways to improve AngularJS performance even with large number of DOM elements
I'm evaluating whether or not to use AngularJS for a web project, and I'm worried about the performance for a feature I need to implement. I would like to know if there's a better way to implement ...
0
votes
1answer
31 views
Angularjs reset form field with type of email
In AngularJs it seems that when you try to 'reset' a form, by setting all of the models to an empty object, if an input is type="email" this doesn't get cleared. Changing it to type="text" works ...
3
votes
1answer
18 views
ngRepeat and directives execution order
When an Angular directive contains an ngRepeat element, the ngRepeat execution appears to to occur after the containing directive's link execution.
Is there a mechanism ($watch, $observe, etc) that I ...
1
vote
0answers
66 views
Framework for realtime nodeJS application
I have a little question. Which framework suits best for my planned application.
About the app
It will be modular realtime app for user collaboration on everything that company needs.
So there will ...
0
votes
2answers
23 views
breezejs angularjs ToDo SPA template in Visual Studio
I have a question about design. I've just been through the code of the ToDo template of Visual Studio for building a SPA with BreezejS and AngularJS.
There is a todo.model.js file that do various ...
0
votes
1answer
33 views
AngularJS render html as string
In my web app, when I go to one of my url, angularjs returns me haml template as a plain text.
But if I go to my root url it works fine. I use Rails 3.2.13, AngularJS 1.1.4, Haml for views.
This is ...
2
votes
1answer
80 views
Does AngularJS support AMD like RequireJS?
In this repo AngularJS is implimented with RequireJS for AMD.
In this repo the AngularJS team seeds an AngularJS project with AMD that does not include RequireJS.
Am I thinking about this the wrong ...