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.
2
votes
1answer
47 views
Using one service ($http) on all the controllers
I have recently started working on angular.js and I like it. I have decided to use a single controller per view. I use the json data from the backend. As my work is progressing, my codes are getting ...
3
votes
1answer
130 views
Using $q in Angular JS to pass navigator geo JSON from factory to controller
This code is used to get the users location and deliver it as a resource to the controller. The aim is to have this data shared across multiple controllers in the application. So far this does deliver ...
1
vote
1answer
53 views
0
votes
0answers
28 views
Service per Controller
We have a base module consuming the company API. In each app I've written almost always a service per controller. Because most controllers are specific to a entity (a single user, a single post, list ...
0
votes
1answer
31 views
Displaying information served on the client
I recently did a coding problem for an interview that unfortunately led me to not getting the position. So I figured I'd get the code reviewed by other professionals because after asking about the ...
1
vote
1answer
98 views
AngularJS expression redundancy in templates
I sometimes find myself using multiple expressions checking on a single flag to control the state of some template, in this example, a Facebook log in button.
On a second look, however, I noticed ...
1
vote
0answers
40 views
Authentication system - AngularJS & Ionic Framework
I am building a small mobile app using ionic framework and angularJS. It will consume a Restful Web Service that requires authentication (User token). This means I need to keep my users token by ...
1
vote
0answers
24 views
Custom forum paginator for navigating through topics
I've made my own pagination service for my forum that I'm working on. I'm quite happy how it turned out but it feels a bit rough around the edges so I would like to know how I can shorten this code ...
2
votes
1answer
152 views
Angularjs CRUD views, controllers, navigation
I just started to learn AngularJS. I created a simple site using ASP.NET MVC as a backend.
I created 1 main view and 4 partial views for the CRUD operations with a Company Entity.
In the main page I ...
1
vote
0answers
25 views
AngularJS select box
This is my first open source release and I'd like to get some feedback on my code styling/organization. Implementation tips are appreciated as well.
The code is for an AngularJS select box that ...
7
votes
2answers
7k views
AngularJS Tab Control
I'm experimenting with angular directives, and as a proof of concept I wanted to create a basic tab control. I'd like to know if anything can be changed to be more fluid, or if I'm doing things ...
2
votes
1answer
38 views
Angular user creation process
I've written 3 factories as a part of a sign up process in AngularJS and Firebase. After completing them, I thought to myself, would any of these fit better as a service instead of a factory? From my ...
2
votes
0answers
19 views
Click interceptor directive
I needed a simple way to add this test to certain click events:
if isUser then fireClickEvent else openSignInModal
So I made this directive:
...
2
votes
0answers
34 views
Resource that use two different services and query with pagination when resolved
I'm learning Angular and I don't like my current approach. The current controller uses first Geolocation service and when ...
2
votes
0answers
25 views
Search box with multiple terms
I'm implementing a live search in a Chrome app (no cross-browser magic required), and have separated the search functionality out into its own module. I want the user to be able to enter multiple ...
1
vote
2answers
36 views
2
votes
1answer
27 views
Removing duplication in AngularJS Factory
I have multiple API calls so I created a service however I would like to find a way to remove the duplication
...
10
votes
2answers
2k views
AngularJS Todo List - too much controller logic?
I am starting an angular app and I was wondering if I am on the right track with this. I worked on my last angular app when I was just a youngun who didn't understand the important of designing the ...
2
votes
2answers
88 views
Pulling data from different JSON files
I have a controller that pulls gets data from two different JSON files. One of the calls loadProducts happens when the controller is initiated. The other one, ...
2
votes
0answers
358 views
Is this implementation for token based authentication in flask-peewee secure and efficient?
I'm making an app with a Flask API backend using a Flask-Peewee ORM and an AngularJS frontend.
The Flask-Peewee ORM doesn't support token based authentication, so I decided to try to implement this ...
5
votes
2answers
389 views
Dynamically load assets (CSS+images+controllers) on route resolve
I wrote a little factory to dynamically load assets in angular resolve. Is it well structured and can it be made prettier?
...
1
vote
0answers
25 views
Chaining HTTP requests becoming unreadable
I'm dealing with some very frustrating API's that requires a bit of filtering/processing data in order to get the results I need.
I need to make 2 API calls, one of which returns a list of asset ...
0
votes
0answers
14 views
Code enhancement for existing npm package
I am trying to improve the code in the npm package. I have looked through the code but don't have any ideas how to write proper code.
GitHub
...
2
votes
0answers
30 views
Online store for pies - Part 2: User authentication
I'm building an angular application using AngularJS and AngularFire. As this is the second part of this "series" it might be a good idea to also check out part 1 to gain an even better overview of the ...
6
votes
1answer
149 views
Online store for pies - Part 1: Create your account to buy delicious pies
I've got a goal and that goal is to become an Angular expert. So what better way of learning than to create an online store for pies, right? I've just finished the registration part and would like ...
2
votes
1answer
58 views
Wait for all resources to be loaded
In my application I need some resources to be loaded and I have services to load each of them and then I need some point to know that all requests finished. First thought was to use $q.all with array ...
4
votes
1answer
59 views
“Stack Exchange page visits” alike implementation
The objective is to increment the page visits by one. The user should not be able to do this by refreshing. The number of visits can be incremented only if the user's last visit was later than 10 ...
4
votes
1answer
110 views
AngularJS trivia game - separating controller from directive
I am creating a trivia game (purely for learning purposes) using AngularJS, NodeJS and MongoDB. My concern is related to the way I am organising the code in AngularJS. So far the game is functional, ...
5
votes
1answer
1k views
Basic and simple view, add, edit and delete functionality
I want to know what needs to improve with my application. Maybe there is a better way instead of what I am using currently.
index.html:
...
4
votes
1answer
93 views
Angular Modular File Structure
My intention is to separate components on a file basis. For example, I want a specific controller to have it's own file (Same goes with services, filters and directives). Of course, files will be ...
2
votes
0answers
65 views
Returning an object from service
In terms of readability, efficiency, and the best convention, which of the two is best?
Snippet A:
...
2
votes
1answer
203 views
Adding a custom field to Routes - clever solution or terrible hack?
I need to make sure the correct menu item is highlighted according to which URL is currently being viewed.
Now the problem with our site is that each menu item can represent several pages. So the ...
1
vote
0answers
59 views
Optimizing a ng-repeat tilemap
I am creating an mapeditor web application like tiled
My ng-repeat looks like this:
...
4
votes
0answers
68 views
JavaScript/Angular TicTacToe Minimax AI
I am interested in getting some feedback on the code for my TicTacToe game, implemented with Angular, particularly with respect to the AI logic, which is printed below. (The full code base is ...
1
vote
0answers
61 views
AngularJS wrapper for p5.js - p5 directive and service
I wrote an AngularJS wrapper for p5.js called angular-p5:
...
3
votes
1answer
79 views
Using the $q service in AngularJS to handle promises
I have a service which needs to store some settings data in a DB and at the same time maintain a reference to that in the user'slocalStorage (we want two users ...
2
votes
1answer
44 views
Movie selection app
I'm new to Angular and I would like some advice on how I can improve my code. The main things that I want to focus on are decoupling and code correctness.
HTML:
...
3
votes
1answer
136 views
Retrieving album artist info from third party API
I've recently just started with AngularJS and the best way for me to learn is to get some criticism to find out how I can do things better. I did a small project that calls a third party API and shows ...
1
vote
0answers
40 views
AngularJS Translation Filter
I'm very new to AngularJS. I'm using a directive for translation of category objects like:
...
1
vote
0answers
30 views
Newsfeed app for allowing custom Reddit feeds
I'm currently working on a newsfeed app (see it live here or its files on GitHub) that lets a user create a custom Reddit feed. The user adds the subreddits they'd like to view, and then can view them ...
1
vote
0answers
244 views
Angular Directive for adding/removing active classes navigation
I have created a directive which is doing several things, all revolved around adding and active class to navigation elements when clicked. It also adds the class when someone goes directly to the url. ...
2
votes
0answers
181 views
Parse recursively a json object with AngularJS
Is there a better way, or the correct one to have this approach for a JSON object that hast the following structure? (it's only a portion of my object, the most important one)
...
1
vote
0answers
41 views
Using EJS Partial for commonly used <input> layout
I have a lot of <input> elements in my single page app that share a similar style for validation. To decrease the amount of code repeated (following DRY ...
1
vote
0answers
69 views
AngularJS Nested Directives
In an effort to learn more about AngularJS directives, I decided to create a simple, edit-in-place directive. I built a simple directive that would display a value, along with an edit link and the ...
2
votes
1answer
45 views
Share data between controllers with service
I have to share data between controllers. In this example I'm using an aside. This has the exact same functionality as a modal from Angular Bootstrap.
I put the aside in my service so I can close it ...
1
vote
2answers
80 views
Angular Todo Lists - Factories? Controllers?
I have an angular app using a restful API which works, but I know is structured poorly.
I'm using a projectService (factory) to do all interfacing with the REST ...
10
votes
1answer
2k views
Simple Async Google Maps initializer with AngularJS
Here is a simple reusable AngularJS factory I came up with to initialize Google Maps Asynchronously, which somehow does not seem ...
7
votes
2answers
64 views
Interdependent color swatch widgets
To illustrate some algorithmic problems I found while writing this code review, I needed to include a live demonstration, which I implemented using a Stack Snippet with Angular.js.
The demonstration ...
3
votes
1answer
5k views
Dynamically generating a HTML option list using Angular.js
I used step 4 from the Angular tutorial to do some tinkering of my own. In that particular step of the tutorial, a option list is created that determines how a list ...
0
votes
1answer
36 views
The right place to place angular modal
In my app I have a BaseCtrl, which is attached to the body element and is available everywhere.
In the mentioned controller I ...