Tagged Questions
AngularJS is an open-source JavaScript framework. Its goal is to augment browser-based applications with Model–View–Controller (MVC) capability and reduce the amount of JavaScript needed to make web applications functional. These type of apps are also known as Single-Page Applications.
0
votes
0answers
7 views
ng-repeat shows nothing with init angularjs
<body ng-app>
<div class="container" ng-init="nameList=['Adam','Rain','John',King]" ng-model="nameList">
<input type="text" ng-model="nameText" />
<ul>
...
0
votes
0answers
14 views
Angularjs directives without html in the code?
I'm learning AngularJS and I have a bit of a problem with directives. I don't like how they look. Specifically, I don't like when there is a lot of html in the middle of the javascript. Look at the ...
0
votes
0answers
5 views
AngularJS directives - directives on transcluded content
http://plnkr.co/edit/XbgMa9681GkKPeodplJx?p=preview
Please see the above plunker. Is there a way to bind directives in template dom to the parent directive's scope? I've seen this behavior with ...
0
votes
0answers
7 views
Internationalization using Angular JS
I'm a newbie to Angular JS. I've just started reading directives. I got my first task of Internationalization. I've gone through the docs of Angular JS i18n. They gave the very basic. Can any one ...
0
votes
2answers
20 views
Binding isn't working in Angular
What is wrong here?
JSFiddle.
function SecondCtrl($scope, Data) {
$scope.data = Data;
$scope.reversedMessage = function(message) {
return message.split("").reverse().join("");
};
}
0
votes
0answers
2 views
S3 uploads thru angular
Using this plugin
Sooooo ive got a problem
So, i am generating a signed S3 url on my server, and attempting to upload using this plugin. I can generate the url and upload a file using
How its ...
1
vote
2answers
29 views
How do I call a function using $scope from HTML added by a directive in angularjs
I moved the following HTML from a controller to a directive, as part of HTML I wanted subbed in when a button was clicked. The problem is that now the save button(below) does nothing. I tried ...
0
votes
1answer
11 views
ng-show=“true” but still has class=“ng-hide”
I'm new to AngularJS, so there may be a simple resolution to my problem. I've been working on this form. I have two inputs - one is for the number of doors and one is for the number of windows. I then ...
0
votes
0answers
10 views
What's the best way to implement authentication in angularjs and symfony2?
I'm trying to write an application with symfony2 for the server side and angularjs for the client side. All the communications between server and client are done using REST api.
What is the best way ...
0
votes
0answers
23 views
Programmatically invoke the browse dialog of input type=file using AngularJS
I want to have a separate span which invokes the "browse" button on
an input type=file. In internet explorer it is not working,
Code is given below
HTML
<span class="edit-btn" ...
0
votes
0answers
15 views
Angular unordered chained select
I trying to figure out an unordered chained select using AngularJS:
http://plnkr.co/edit/7dJRxdzBTe9N9R1xc6gq?p=preview
e.g. At first selectbox when selected is 'Femininos' and third selectbox is ...
0
votes
2answers
25 views
Why doesn't my $scope reflect my controller being initialized?
Question:
Why is {{ name }} resulting in blank?
Plunker:
http://plnkr.co/edit/32t8u4VL9BiuhHcC80LF?p=preview
Script:
var app = angular.module('app', []);
app.controller('MainCtrl', ...
1
vote
1answer
30 views
Angular controller scope not updating after jQuery ajax call
i have this code and i can't see where is the source of problem, i don't get any error in the chrome console
my controller :
function notifController($scope) {
$scope.refreshMsgs = function () {
...
0
votes
1answer
19 views
How would i return value from angular factory if the data is fetched with http
I have this factory in angular:
'use strict';
angular.module('finansiiApp')
.factory('transactions', function ($http) {
var transactions = [];
$http.get("/api/transactions.json").
...
0
votes
1answer
18 views
JSON Object's child array not being returned with AngularJS
I'm having trouble getting an object's child array to be displayed with AngularJS.
In my app.js, I'm defining an array of objects as my main scope.
function MainCtrl($scope) {
$scope.products = ...
0
votes
2answers
15 views
angularjs ng-option obj confusion
my markup
<select ng-model='selectedPerson' ng-options='obj.name for obj in people'></select>
and this is my js:
app.controller("MainController", function($scope){
...
0
votes
1answer
12 views
How do I disable enter animation in angular js version 1.2.0
I have used the example on
http://www.yearofmoo.com/2013/08/remastered-animation-in-angularjs-1-2.html
I am able to get the animations to work. But I would like to ONLY have the leave animation. Is ...
1
vote
1answer
34 views
How to provide initial data to Angular's controller/$scope?
There seems to be no way to provide data to an Angular controller other than through attributes in the DOM handled by directives (of which ngInit is a handy example).
I'd like to provide other ...
0
votes
1answer
14 views
AngularStrap tooltip disables my custom directive
I am trying to get the bs-tooltip AngularStrap directive to work with my own custom directive called "checkStrength" which checks the strength of a password. When using either of these directives ...
0
votes
2answers
30 views
AngularJS Route Controller Not Reloading
I have a very simple AngularJS app that has two routes in it:
#/search
#/results
When I navigate from one route to another everything works as I'd expected. Any resources that are needed are ...
0
votes
1answer
26 views
Avoid multiple ajax requests angularJS
I am trying to avoid multiple ajax requests to the server in a factory. I already added a small caching service, but it is not enough for what I aim: this factory can be called several times before ...
0
votes
2answers
26 views
Expandable content in tables using AngularJS
I've been following the tutorials for AngularJS over on Egghead. Things are going pretty good, until I decided to try to combine some concepts.
My main.js is located here, due to the fact of the ...
0
votes
0answers
7 views
Authentication when using angularjs and passportjs
I am currently using passportjs for authenticaton.
I have come across a stage where i need to ensure the user is authenticated if the url is typed in the browser/ I have been using the passportja ...
0
votes
0answers
15 views
UI Router not working with Angular not matter what
(angularJS 1.2.5 & ui-router 0.2.7)
Please help its 4 in the morning and its been 2-3hrs since i'm stuck with this, flipped the code multiple times but cudn't make it run.
In my index.html, I have ...
0
votes
2answers
32 views
Broadcast from Angular to a jQuery Listener
Trying to get AngularJS to broadcast a custom event that jQuery is listening for.
In the jQuery I have something similar to this:
$( document ).on( "myCustomEvent", function( event, data ) {
$( ...
-1
votes
0answers
21 views
AngularJS - iterate all cached partials
I have routing set up via $routeProvider, something like
$routeProvider.when('/page/:id',
{templateUrl: 'partials/public/view/page.html', controller: XYZ});
On first page load, I'd like to iterate ...
0
votes
0answers
27 views
ng-click and jQuery click events not firing inside ng-repeat list items
I have some funny behavior going on inside a ul generated by ng-repeat. Here is my code:
<li ng-repeat = "Store in Stores" ng-show = "hasSelectedServices(Store)" class="store">
<div ...
0
votes
1answer
17 views
Working with a restangular sub resource
I have a child resource which will have full set of methods associated with it. I am starting to implement the create (i have the back end working). Essentially I want to be able to work with this ...
-1
votes
1answer
22 views
set default value to first in ng-options?
Ok i have this:
scope.$watch('item', function(){
var getmonthdrop = scope && scope.item && scope.item.month;
var getyeardrop = scope && scope.item ...
0
votes
3answers
22 views
AngularJS - accessing returned scope method variables in another method
I have an Angular app with a service and a contoller:
service.js
.factory('MyService', function ($http, $q) {
var api_url = 'http://localhost/api/';
var MyService = {
list: ...
0
votes
2answers
23 views
Check if value in array in angular template?
Is there any way to check if a value is in an array in an angular template? I'm looking to something like this:
<div ng-class="{'myClass':1 in [1,2,5]">Yay</div>
Where myClass is ...
0
votes
1answer
15 views
AngularJS serverside variable to ng-init and methods sequence
I´v got a "detail" view and a controller that initilizes data with an id.
My view:
<div ng-app="AFApp" ng-controller="AgentCtrl" ng-init="init('@Model.Id')">
My controller:
$scope.id;
...
0
votes
1answer
22 views
returning a json object/array to the browser with a rendered view
Currently my controller does this
public function index()
{
$trainers = $this->trainer->with('user.images', 'types')->get();
return View::make('trainers.index')
...
0
votes
1answer
20 views
Updating models in controllers with AJAX Angular JS
I am sure this is an easy answer but I am not finding it anywhere. Essentially I have a $http service that brings back a JSON object with a ton of data that I need to use like so:
(function ...
0
votes
1answer
6 views
Error loading scope into jade template using angular
I am working on a simple angular/jade template, and I am getting an error wen trying to load in information to my template.
layout.jade:
doctype
html(ng-app)
head
title= title
...
0
votes
2answers
23 views
$watch listener being called once without change in expression
In my controller I have a variable called datetime which is updated by a timer every second. I need to do some work when the day changes, so I registered the following watcher:
...
-1
votes
2answers
35 views
Best way to apply a class to one element when another is selected (via Angular)?
I have a long form laid out in Bootstrap, with the labels in one column and the inputs in another to the right. To help clarify to the user which field he's editing, I would like to change the color ...
0
votes
0answers
17 views
Lightweight way to mock an angularjs service's method?
In the code below I'm trying to alter the getFilters method of my Filters service directly, for this single test, which doesn't seem to work, seemingly the injector gets in the way (I'm pretty new to ...
0
votes
2answers
30 views
returning object from ng-repeat or ng-options?
Ok i have the following:
<select ng-model="item" ng-change="monthpickerclick()">
<option class="animate-repeat" ng-repeat="returnpicker in monthpicker(singles)" ...
2
votes
1answer
24 views
Intelligent folder structure for grails 2.3.4 in combination with angular js
What would be an intelligent folder structure for grails 2.3.4 in combination with angularjs without using the grails angularjs plugin?
Currently I have packed everything into the webapp folder.
0
votes
1answer
23 views
Accessing and using JSON within an Angular service for logic flow
I asked the wrong question yesterday (and got a goodanswer that worked), but am realizing it's not what I needed. I need to be able to retrieve JSON data (preferably once), store it, and access it ...
1
vote
1answer
21 views
Binding dynamically to ng-model for multi level deep object using Angular JS
I am fairly new to Angular JS and I have run into a problem. I am creating a dynamic form where the elements come from the Database for example:
order object:
public int Id { get; set; }
public ...
1
vote
3answers
18 views
Issue getting information to jade template with angular
I am working on a simple web app (new to it) and I am using jade/angular. I am trying to get a list to display some information, this is what I have:
layout.jade:
doctype
html(ng-app)
head
...
2
votes
1answer
17 views
Initialize Zurb Foundation 5 in an AngularJS Directive
I've created three plunkrs to illustrate my problem. I'm trying to create an AngularJS Directive that will initialize foundation and apply the necessary javascript to the loaded template. At first I ...
1
vote
1answer
14 views
angular directive encapsulating a delay for ng-change
I have a search input field with a requery function bound to the ng-change.
<input ng-model="search" ng-change="updateSearch()">
However this fires too quickly on every character. So I ...
0
votes
0answers
19 views
AngularUI modal - displaying on page
I am using AngularUI 0.8.0 (with bootstrap 2.3) and trying to get a simple modal box to display.
Using the code below, when I press Open, the template and controller load, the alert is displayed, db ...
0
votes
1answer
5 views
error with indentation using JADE
I am trying to create a simple jade template (I am relatively new to jade) and I keep getting an error with this piece of code:
extends layout
block content
h1= title
...
4
votes
5answers
61 views
Representing null in JSON
What is the preferred method for returning null values in JSON? Is there a different preference for primitives?
For example, if my object on the server has an Integer called "myCount" with no value, ...
0
votes
1answer
18 views
Connect to second database in hibernate,angular, spring
I am creating project in spring, angular and hibernate. I configured the database in memory and everything works. Now i have second database on my server with data. I want to retrieve data from the ...
0
votes
2answers
27 views
Do I NEED to supply a template for an Angular directive to wrap content?
I think I might be trying to fit a square peg into a round hole here. What I want to do is to define a convention for attaching some generic JavaScript functionality to a particular HTML attribute.
...