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.
13
votes
2answers
304 views
AngularJS - REST + Authentication service
I have a REST web service that uses OAuth 2 for authenticating and authorizing requests.
I have an endpoint, that when receiving the correct credentials, responds with an access token that will be ...
4
votes
0answers
37 views
AngularJS inheriting from a base directive
I'm wrapping ui-select in my own directives to pre-configure and style it, as I need it for my app in different select widgets. They appear on many pages, for example ...
0
votes
0answers
44 views
Initializing an AngularJS app
I've created code in each of my controllers and directives that calls an initer function in the main app.js module, the function just passes strings which are ...
3
votes
1answer
31 views
MVC partial views and AngularJS modules
I am using MVC+Angular. In MVC, I created partial views for search, listing, etc. I show them using:
...
3
votes
2answers
46 views
MVC and Services
I'm writing and app in AngularJS and am learning about writing RESTful services. I also want to make sure that I'm understanding the MVC pattern correctly. In my code, this is my take on how I'm ...
0
votes
1answer
37 views
AngularJS to-do list controller
I am new to Angular. Am I following best practices here? I understand controllers should not do too much. My controller seems to have a lot of logic here. Can I do anything to improve it? It is just a ...
1
vote
1answer
17 views
Shuffling and hiding views specified by parameters
In my Angular app, users click on different icons. When a user clicks on respective icon, I can show the icons gallery, as well shuffle the view.
Apart from this ...
2
votes
1answer
27 views
Navigational bar content built depending on login state
I created a login service which holds a boolean based on if a user is logged in or not.
...
1
vote
1answer
42 views
0
votes
0answers
7 views
Angular controller to fetch information on conractors [sic] and projects
In my Angular controller, I am using 3 different functions to get the data. It works fine, but is there a way to simplify this?
...
3
votes
1answer
42 views
Checking tag colors
I have an array vs.tags which may contain hundreds of objects, and a smaller array coloredTags which only contains up to 3 ...
3
votes
1answer
58 views
Creating a symbol toolbar with Angular
I have been given a requirement to create a symbol toolbar, a toolbar where each button represents a unique symbol.
This is how the toolbar would work:
A user clicks inside a text field and enters ...
2
votes
1answer
14 views
Showing popup according to the header nav link
I am showing templates in popups according to the user navigation links. It works for me, but, is this the correct way to do it?
...
6
votes
2answers
158 views
Profiles with profiling checkboxes
I have this HTML down below that creates a list with two columns, the left one containing profile information, and the right one containing checkboxes of the user feedback in a horizontal list.
The ...
-1
votes
1answer
38 views
21
votes
5answers
802 views
Cardshifter game lobby
We've been hard at work creating a browser-based GUI/Client for playing the Cardshifter TCG for the past week or so. Today, I just finished doing a pretty complicated layout for the chat lobby, along ...
4
votes
0answers
57 views
Datepickers for departure and return dates
I have to two datepickers. I want achieve a following functionality: when return date cannot be selected before departure and departure cannot be after return date. Mainly I am interested in ...
3
votes
1answer
35 views
Width-based panel collapsion
This code adds the toggle functionality for mobile devices. So, for width lower than 990px, the panel collapses, and the user can toggle to open / close it.
...
0
votes
1answer
57 views
Formatting data for use in a controller
I am using the function inputSetup to prepare an array for a multi-select directive. I am passing in an array with the existing selections (...
6
votes
1answer
160 views
Mocking dependencies when unit testing AngularJS services with QUnit
I'm trying to unit test an AngularJS service that is dependent on another service, using QUnit as my testing framework. The first test I'm writing is one to verify that my service calls another ...
3
votes
1answer
25 views
Adjusting Angular.js model based on browser width
I have an Array of 5 objects, some key values need to be changed based on the browser width. ie: 5 cols, 4 cols, 3 cols or 2.
vs.streams is an Array which is tied to a AngularJS model. When the ...
-1
votes
2answers
60 views
Program that filters JSON data based on user selection
I have made a basic program using AngularJS that displays data from a JSON file, and filters it according to the user's selection (specifically FIFA 15 chemistry cards).
I did plenty of CSS work to ...
2
votes
1answer
38 views
Bootstrap Modals
I am learning how to implement Bootstrap modals in AngularJS. I can do it when the modal code (the actual popup window code) is on the main page, but I want to be able to display external files so ...
1
vote
4answers
170 views
Function to split full name into first & last
In angular, I have an input field for a user's full name. And a function called splitName which extracts the first / last name from the field. Is there a way to ...
3
votes
1answer
56 views
Iterating through a range using lodash/AngularJS and saving data
The code below doesn't seem right to me. The scenario is:
User enters in a "quantity" into a form field.
If the user enters in 5, the loop below should iterate 5 times.
There should now be 5 new ...
2
votes
1answer
66 views
Controller.js of CRUD vehicles
I never took an application in a Model-View-Controller architecture and have some difficulties in front-end. The following code works fine, but what can I do to make "layers" of better code and even ...
1
vote
1answer
39 views
Scroll related inline image resizing
I have been working the some project and I'm struggling to find the answer. Right now I'm coding with Angular and there some code that makes me write twice. There only two arrays now but if I have ...
2
votes
0answers
34 views
AngularJS Cookie Manager
Just looking for an initial steer on my AngularJS implementation.
Background
Started work on a clients new site which uses a popular CMS as the backend and AngularJS has been chosen as the client ...
-1
votes
1answer
39 views
Properly Structured Angular Application
I've been writing a somewhat complicated service that involves a lot of API function calls in Angular. After a somewhat tortured first attempt I have tried to take more of an MVC approach rewritten ...
0
votes
1answer
31 views
Choosing between local and server data
I have some working code, but it seems a bit clunky.
I need to get data from a service. The service will hold the data in local storage if possible (to make it speedier), but if it's not been ...
0
votes
1answer
32 views
Watch for CRUD state changes and make sure only one is active at once
I'm using AngularJS and I have a watch task in my controller that needs to be dried up if possible.
Basically it watches for state changes in my front end. I have 3 buttons: add, edit, and delete ...
3
votes
1answer
59 views
2
votes
1answer
82 views
Idle Miner part 2: levels service
My previous post had no response, so there is part of the whole - levels service. It stores levels with it's attributes. I'd like to hear any suggestions about code readability and code performance.
...
1
vote
2answers
219 views
Typeahead / Autocomplete using AngularJS directive
I am writing a Type-ahead / Autocomplete search with angular using directive and filter service. I am almost there but need your expert opinions on things which I am planning to achieve.
Git ...
2
votes
0answers
77 views
Simple clicker game
I have started my clicker game using angular.js about week ago. I have finished current functionality first night, but still have feeling of misunderstanding some basic approaches.
This is sources ...
2
votes
1answer
102 views
AngularJS image size validation directive
I've written a directive to validate the width and height of an image in AngularJS. I'm not a JS genius but I get along with it. So I would appreciate some feedback on this directives code if this can ...
1
vote
1answer
89 views
Angular filter to format temperature
Below is a basic filter I created with Angular that does temperature conversion. I'd like to get thoughts on how to improve this code from both an Angular perspective and a general JS perspective.
...
3
votes
0answers
185 views
Asynchronous iterator for AngularJS
I wrote this as a convenient way to batch together multiple, repetitive AJAX calls. I was working in angular at the time, so I use the $q service, but I'm sure it ...
2
votes
0answers
44 views
Extending directive scope to server side templates, and deferring dependency injection of modules in AngularJS
I read this article that I really liked and wanted to implement the ideas it had. It basically says don't use $scope or ng-controller; instead, use directives with templates that get their angular ...
1
vote
1answer
58 views
Resolving promises on resolver using ui-router
We're rewriting some parts of our application. We're trying to avoid the promise anti-pattern and do things properly, but I'm not certain that we did so.
More precisely, we are rewriting the resolver ...
2
votes
0answers
19 views
Index-based template
In my code, when the index is 0, I am supplying the second template which contains the word as arif. With the rest I am ...
2
votes
1answer
60 views
Matching and pushing array
This code works, but I feel like it's really hacky and could be done a lot better. Can anyone give some advice on how this could be neater?
...
2
votes
1answer
115 views
Angular Broadcast Asynchronous Events
Okay I have the following use case:
Module A broadcasts an event.
Module B listens to that event.
Maybe also ...
12
votes
2answers
183 views
FizzBuzzLizardSpock
I decided that since I was learning AngularJS and Bootstrap, I'd be remiss not to post a FizzBuzz, but FizzBuzz bores me, so I've extended it.
My version of FizzBuzz is configurable, and allows you ...
3
votes
1answer
30 views
1
vote
1answer
61 views
Flow of Angular Promises
I recently put in a submission for a small coding challenge using Angular. The challenge was to get a token and array of values using a GET request then make another GET request passing the token and ...
1
vote
1answer
46 views
Massive Number Of Scripts With Angular
I've recently started switching from JQuery to Angular and it's awesome at making my HTML expressive and easy to read but every reusable module I make has its own script which leads to a massive ...
1
vote
2answers
54 views
4
votes
0answers
45 views
Using setTimeout to get scrolling chat window to work, but doesn't feel like the ideal solution
My friend and I are working on a bare-bones chat web app, using Angular on the front end. He's using Swampdragon for some of the real-time stuff.
My task that I set out to achieve was to get the chat ...
3
votes
0answers
47 views
Directive to randomly show/hide elements
This directive works fine but I have the feeling that I'm not doing it the "angular way" with .attr('hide', 'true'). Is there a better way to show or hide elements ...