Questions tagged [angular.js]
Code written using version 1 of the AngularJS open-source JavaScript framework. Use 'angular-2+' for code using later versions.
354 questions
7
votes
2
answers
633
views
Beginner's Calculator code
I am trying to learn AngularJS as a start to my revival of learning, I think that I am getting the hang of it so far, but would like to see what I can do differently with some super simple ...
2
votes
1
answer
89
views
Simple console directive, revised using provider
I recently created my first directive based on jQuery plugin and I asked for review here: Angular console like window - first directive
I've edited my directive so now instead of ...
1
vote
1
answer
150
views
Angular console like window - first directive
I've asked question on SO how to rewrite jQuery code to Angular. Because I got no answers I've tried to create something by my own.
This is my version of code:
...
0
votes
1
answer
1k
views
Angularjs alertservice and alertscontroller
I'm a .net programmer with littler experience in AngularJs and Javascript.
I have implemented an ...
2
votes
3
answers
11k
views
AngularJS controller to fetch and display employee data from database
This is the code for an AngularJS controller that I've written:
...
0
votes
1
answer
72
views
Calling the backend REST interfaces to get a timetable of the train
I'm very new to AngularJS and just started in a new project which uses AngularJS for Web UI. I was looking into our code and found out that we have huge functions in controllers. Like, one 100-LOC ...
0
votes
1
answer
121
views
Creating forms using angular
I am a newly developer in angular. I want to do some homework to create forms with Angular. I spent nearly a week to do it, but my teacher was not really satisfied about it. I tried to follow some web ...
0
votes
2
answers
362
views
Partitioning an array of objects into four arrays by one attribute
I have an array of API objects, below is an example of one object:
...
0
votes
1
answer
6k
views
Angular UI Bootstrap Modal scope
I'm trying to improve my Angular skills by writing some basic applications that use a particular feature. The following application uses the UI Bootstrap modal to add users to a list, or remove them ...
0
votes
1
answer
189
views
Angular front end of chat web app
I'm using the MEAN stack to make a small chat app, which will soon support braided messaging. This is my first Angular app so I am not sure how I'm doing on the front end portion in terms of keeping ...
11
votes
1
answer
769
views
Hangman learning AI
I have been learning AngularJS and have written my first app. It's a Hangman AI which learns words and guesses the solution based on the words it knows.
Please look over my code and provide some ...
2
votes
1
answer
253
views
Angular JSON weather app
I'm pretty new to Angular. I wrote a weather app and need my code reviewed. I especially need help on best practices for handling edge cases on the response from the JSON endpoint.
Here's the HTML:
<...
2
votes
2
answers
4k
views
AngularJS shopping cart using local storage
Two weeks ago I started writing some Javascript and AngularJS code for a customer. As a proud newby I must also be aware of the dangers on the big bad Internet. In particular vulnerabilities such as ...
2
votes
1
answer
497
views
User registration factory for AngularJS + Firebase app
The goal for this code is to provide a semi-secure and privileged method of user registration via a secret code that is stored as a key in the Firebase database.
Subscribers to a mailing list were ...
0
votes
1
answer
87
views
Two timeout methods
I found there are two methods to code an if-else statement with a timeout function. Two of these scripts work fine, but which ...
2
votes
1
answer
648
views
Angular/bootstrap radio button directive
I found creating radio buttons in my application a bit of a hassle in terms of having to configure the HTML to do what I wanted when the user clicks/unclicks the items etc.
I figured reducing it to a ...
2
votes
2
answers
107
views
Member-specific object cache for Angular
I'm trying to build a reusable object cache for Angular. The goal is to:
Cache objects by type
Prevent collisions and conflicts
Find objects by like property
Ensure caches are separated by the logged ...
5
votes
1
answer
892
views
Day, month and year clone in to one with MomentJS
There are two methods I am using here for merging day, month and year.
First one
...
2
votes
1
answer
416
views
100 chairs in a circle problem solving with Angular.js and visualization
Here is the problem statement:
Take a second to imagine that you are in a room with 100 chairs arranged in a circle. These chairs are numbered sequentially from One to One Hundred. At some point in ...
1
vote
2
answers
148
views
Recreating a URL string
This is what my viewObject looks like:
...
1
vote
1
answer
82
views
Displaying available destinations using Angular.JS
I wonder to know if there is any bad smell on my practice for i18n on Angular.
I put the I18n translating function on Angular controller (because I don't know how to put it on HTML template file)
And ...
3
votes
0
answers
78
views
Updating offers based on selected products
I have some nokia mobile models with some offers. There are two objects, one for nokia models with price, another one for offers.
For example I have offers for these two models:
"brandname": "Nokia"
...
3
votes
1
answer
3k
views
Currency converter using angular.js
This is my first angular application. I am sure there must be many mistakes like coding conventions, naming conventions or implementation mistakes like what goes where. Could you please review this ...
3
votes
0
answers
98
views
Knowledge base app using MEAN stack
I've been working on an app based on the MEAN Framework. I have got the app working but I just wasnt sure whether my coding structure and standard was good enough, meaning does it adhere to the ...
1
vote
1
answer
101
views
Update / save / display values in a table
I am relatively new to Angular and need to put together an application to update / save / display values. The code is working, but I wanted your input the make sure that I am doing this 'the angular ...
6
votes
2
answers
150
views
Optimize Game of Life
I'm a beginner at coding and the past days I tried to write the famous "Conway's Game of Life" in Angular.js. Right now I'm done with the code and the game works. But if the size of the ...
0
votes
1
answer
147
views
Using basic REST API in Angular 1.x
I have built real-time markdown editor in order to learn AngularJS by practice. I think what I'm trying to do can be done a better way. Any suggestions appreciated. Here's my code:
...
4
votes
1
answer
89
views
Form for registering a user
You have one form and you can register a user. It can be god or mortal, but it also requires all the information to let you save the user or the change. When you have all the registers that you want ...
0
votes
2
answers
101
views
Passing variables by values without the dreaded if/switch/eval
I have to pass a bunch of inputs and outputs between two Angular controllers and I've come up with a way to do it using $broadcast. I'm using an "if" statement to make sure the inputs match the ...
2
votes
0
answers
449
views
Modular Angular structure with Browserify
I am trying to create a basic angular template where all files are sorted into a modular structure and referenced using the browserify require method.
I am very new to browserify and the CommonJS-...
3
votes
1
answer
344
views
Web app to consume rest services and display charts accordingly
I have been an Angular developer for more than 5-6 months and mostly I learned with my experience. However, recently after submitting code to some competition, I got a feedback that AgularJS best ...
2
votes
1
answer
92
views
Angular Box Color Exercise
I have completed an exercise where there are 4 different color boxes and 1 main box below them that is blank, when you click on one of the colored boxes, the main box changes to the color of the box ...
2
votes
1
answer
989
views
Changing page language using a service
I'm rebuilding a basic webpage using AngularJS, and want to implement changing languages when clicking an icon. So far I've made a service called 'langService', ...
2
votes
0
answers
113
views
Properly updating multiple MongoDB documents with Angular
In the app I'm creating, when a user upvotes a post, the post should be upvoted, as well as the user that wrote the post. But this updates two MongoDB documents. This presents a number of issues. I'll ...
2
votes
0
answers
279
views
Angular.js - Using Service to share data between controllers
My Application looks something like this (Screenshot). To Control the URL Routing i am using a Angular Js Router. On Click of Store of the Side Panel the StoreList Appears. And on Click of the Edit, ...
3
votes
1
answer
417
views
Angular.JS table management
I am an Angular.JS beginner and this is my first application. I hope you give me some advices what to do to have better, optimized code.
This application manages the data from database, shows it in ...
2
votes
0
answers
86
views
Wrapping a small animation library for Angular
I've started out working on a larger project using Angular for the first time.
For visual feedback, I'm using Waves (Github) (you can see a demo page here).
The standard way to use Waves is to ...
1
vote
2
answers
189
views
Checking if an element exists in an array efficiently and return it
I am writing a function for my node/angular app that will prompt the user with a random question that he was not asked before.
To achieve this I wrote this function:
...
7
votes
1
answer
2k
views
AngularJs Module Run Block, Configuration, and Route Definition
My AngularJs app is currently working fine. I'm working on modularity, refining my code design, and making it more readable. I have a app.js file that contains the ...
4
votes
0
answers
122
views
Angular controller scope inheritance vs service
On my site I have a navbar component that I want to customize for each and every ng-view I end up loading. Currently I'm doing ...
0
votes
1
answer
343
views
Angular JS $HTTP for nested array
I'm using a factory for my $http get requests.
When I pull single json objects from the $http, it works pretty quickly
I now have items coming through as an array. It is very inefficient, & ...
6
votes
1
answer
107
views
An object exposed to directives that need to track changes on it
This is an object exposed to the view and is being used on directives within the same view. The directives need to track changes on the ctrl.filters.applied object. ...
3
votes
1
answer
189
views
Angular controller without single responsability
I'm new in cordova / angularJS and I wonder how much responsibility a controller can have. This particular one validates users entry data, display messaging, takes pictures calling the camera API, ...
8
votes
1
answer
662
views
Two AngularJS controllers for camera actions
I have the same functionality in two controllers and I want to refactor to place it in a shared method that both controllers can access. I was thinking on creating a separate service called "Camera" ...
11
votes
1
answer
835
views
Handling Java instant Ajax request/respond with Angular
I am trying to build a food search app. I am using Angular and Spring. I am currently using the yelp API, but it's done on the Java side.
I think what I have achieved is really bad design. It works, ...
2
votes
1
answer
214
views
Entity Framework Code First Softball Stats Database Schema
I am creating a website for my buddies and I to track all of our offensive softball stats. I am getting tired of maintaining a huge excel spreadsheet and emailing it out every week, so a website is ...
4
votes
1
answer
242
views
Angular using defer and services
I have wrote some service in AngularJS that use defer, can you check my code and tell me if I getting it right?
Service (I dont really like name: ...
2
votes
1
answer
109
views
ngCordova plugin for audio player
I wrote a Cordova plugin for an app that I'm working on, and now I'm trying to write an Angular definition to wrap my plugin. So far, I've followed the model in ng-cordova.js:
...
3
votes
0
answers
79
views
QA form framework in Angular.js
I've just done my first Angular.js project and can't help but feel I have too much code outside of the framework.
jsFiddle
This is a QA form scoring page that will eventually store it's results in a ...
2
votes
1
answer
241
views
AngularJS: Http API Service - any improvements / remarks?
Could you please review the below AngularJS service. What it does is centralize all (relevant) HTTP action calls.
Do you see any chances for improvement?:
...