Questions tagged [angular.js]

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.

Filter by
Sorted by
Tagged with
2
votes
1answer
58 views

CSV-simplified: A small open source project

I'm working on a small open source project called CSV-simplified for a course I'm taking (Bloc), and I'm looking for some feedback and potential collaborators. I don't actually know an programmers, so ...
2
votes
0answers
57 views

Addition of defaults to components in AngularJS

I wrote a small module in typescript that augments the angularjs registerComponent function to provide a new way of default values for the component controller. ...
3
votes
1answer
58 views

Create objects corresponding to whichever field has value from among a list of fields

I have to create a form, which enables users to move stock of items to different statuses. The form will show the current stock(quantity) in a given status and then 5 input fields corresponding to 5 ...
2
votes
1answer
210 views

Paginated AngularJS posts application

I have made a small application that displays a posts JSON in the form of cards, with the help of AngularJS and Twitter Bootstrap 4. The application has an interface for pagination and there are ...
2
votes
1answer
64 views

show/hide components

The following code is used to show/hide components in an AngularJS app: ...
2
votes
1answer
67 views

Comparing JSON documents for changes to values

Please go through below code and improve the quality by reducing the IF conditions: I have 2 jsons, first one is the source and second one is the updated json. I have to compare both values and set ...
2
votes
1answer
2k views

Script to load controllers dynamically for AngularJS

I would like to hear your thoughts, idea's or feedback on the following code. Ive added to code to github. https://github.com/redbullzuiper/angularjs-dynamic-controllers Usually when you attach a ...
2
votes
1answer
77 views

A simple AngularJS application for counting the number of gallons of paint

I created a simple Angular JS application for calculation gallons of paint needed to paint the ceiling of a room. I assume one gallon covers 350 square feet and use it as a constant. Also, I round up ...
0
votes
1answer
31 views

Deep custom AngularJS Filter

I need to filter projects using a searchbar, it should filter all properties of the projects with a few exceptions. It's working, but it's extremely slow, where can I make optimizations? The "_" is ...
2
votes
1answer
151 views

Laravel Single Page Application Using Angular Js

I have created a Laravel Single Page Application using Angular Js 1.3.14 by learning tutorials in the websites. index.php: ...
2
votes
3answers
55 views

Collecting a list of documents from a factory for an AngularJS controller

With this controller I'm injecting myFactory and using Array.push() to add the array ...
0
votes
1answer
4k views

Move an element up / down an array in Javascript

I have an array called list bound to the current application scope $scope that is a user order-able list of UI components. When ...
1
vote
1answer
69 views

Chaining three promises in Angular.JS

I have demonstrated promise chaining where promise's p1,p2,p3 has to be resolved synchronously. The code below is using angular.js 1, and here P3 is resolved then P2 and then P1. ...
1
vote
0answers
49 views

JavaScript/Angular 1 - Multiple complex ng-if conditions properties

I have 4 ng-if which are related with the same conditions properties: ...
2
votes
1answer
79 views

AngularJS - Making Factory and Controllers DRY

The following code works, but: The service makes multiple API calls, the functions are very similar with a lot of code duplication. The same is true for the controllers- very similar code with only ...
1
vote
0answers
567 views

AngularJS Null coalescing operator filter

I am relatively new to AngularJS and am coming from a PHP background. One of the new features for PHP7 was the Null coalescing operator. In short, it checks if a value is set and if it is then it ...
3
votes
2answers
153 views

Traverse and modify a deep object

I wrote this piece of code yesterday at work. This function will traverse a deep nested object to find and modify a value. I know it's bad, so I am trying to refactor it. I have not found any ...
2
votes
0answers
190 views

AngularJS application for working with the Facebook API (using the cordova-plugin-facebook4 plugin)

I'm creating an application with AngularJS, and packaging it up with the Phonegap build. I'm using the facebook API (phonegap cordova-plugin-facebook4) for user authentication and getting a user's ...
4
votes
2answers
62 views

Grab the first 4 items that meet the condition from a data set with an unknown size

I was turned down for a job after a coding take-home test, and some of the feedback I received was: would have preferred to see more functional programming instead of while loops - and the while ...
0
votes
1answer
32 views

Managing JS objects while preserving references

Scenario I have foo: { name: 'Mr. Foo', value: 4 } I receive bar from the server:...
4
votes
1answer
117 views

Simple angular app - Shopping website

In looking for a bit of feedback about an Angular app I have created. I'm new to angular I want to clean up the loose ends before I carry on and add new functionality. Below is the code snippet of ...
3
votes
2answers
333 views

Splice from Array if index matches

This code loops through an array called $rootScope.watchlist (uses AngularJS). It gets the current iteration of the loop to access that x iteration through ...
0
votes
1answer
1k views

File upload in AngularJS causes browser out of memory error

I have an AngularJS code to perform upload of files. At first I thought it works OK but when I've tried to upload bigger files (e.g. 5 files, 10 MB each) then I saw that this code has very poor ...
3
votes
1answer
368 views

Returning the results of four $resource calls as a JSON array in AngularJS

Title pretty much says it. I need a way to elegantly handle multiple $resource calls in AngularJS. Right now, I just calling each other call on the ...
1
vote
2answers
72 views

Unit tests for a single JavaScript function

Here is the question: What is the better way to unit test this specific function? Should all the test items be included in one test or is it better to break up the tests so each test is testing for ...
1
vote
1answer
91 views

Tying the enablement of one checkbox to another using AngularJS and jQuery

I'm new to AngularJS, coming from a jQuery background and I have a situation I've solved but only by including jQuery in an AngularJS function. Something just doesn't feel right doing this and I was ...
2
votes
0answers
73 views

Angular 1 CSS Encapsulation

I am trying to get a good clean way to do CSS Encapsulation in Angular JS. The main goal of this is to use isolated components. This is what I have come up with so far. The method I am using is ...
4
votes
1answer
829 views

Step by step wizard

I'm currently working on creating a step by step wizard in Angular and twitter-bootstrap. I've actually got it to work as intended but as I'm looking to advance my skills I'd like to hear if you have ...
2
votes
0answers
118 views

breacrumb directive for angular-ui-router

This is a simple directive that creates breadcrumbs on the fly for Angular.js pages using angular-ui-router ...
3
votes
3answers
222 views

Use counter for ajax loader

I was using a Boolean var for indication of loading so my code looked like this: (this example is in angularjs but i think it can be relevant for any ajax call handlers) ...
4
votes
1answer
68 views

Getting hex colours from a image

I am trying to get the hex colours from an image. The problem I am having is that for some reason randomly the code causes high CPU usage, which times out the browser and I am not sure how to optimise ...
0
votes
1answer
270 views

Generating a list of menus with AngularJS

Some days ago, I decided to start learning a JS framework in order to gain skills and become more useful at work. I choose Angular for the purpose, and started learning it by building up my "...
5
votes
1answer
211 views

Particle text directive

Directive that shows text as particles on a canvas. Looking for a general review. Plunker here. image.service.js: ...
5
votes
1answer
787 views

Using chartJS in Angularjs to plot IOT data

I am a Javascript and AngularJS beginner. Below is the code inside my chartController. What this does is get IOT data from a back-end call and display it in my front-end with a chart. There are two ...
0
votes
1answer
295 views

Communication to Child Controller

This is a simple AngularJs application with two nested controllers. We need to pass data from the parent to the child Controller. The first thing you find when googling for a solution would be this, ...
4
votes
1answer
1k views

Displaying a table using DataTables and AngularJS

I am using DataTables to format and display a table. I started the project using AngularJS with a PHP backend but I needed to inject some Vanilla JS and JQuery code in order to use DataTables. Is ...
0
votes
1answer
140 views

Car dealership landing page

Please give feedback on what I could do better next time. This is an Angular 1.x landing page I made for a pretend car dealership. Here is what it looks like. Here is the app.js: ...
4
votes
1answer
130 views

Handling two datepickers in a form with angularjs

Here's I am using simple form with angularjs. Everything works fine. I am having watchgroup for EndDateFrom & EndDateTo datepickers. When it's defined I am logging the value to console. I am ...
5
votes
2answers
25k views

JavaScript filter() on JSON object?

I'm building a web interface for a home monitoring sensor array, and fetching JSON from the backend framework. I want to start putting statistics together for monitoring different areas of the home, ...
2
votes
1answer
2k views

Performance problem with Angular and rendering a grid

I have a big problem with performance with a web application using AngularJS. I currently have a grid that renders an array of objects. It looks something like this. ...
3
votes
0answers
410 views

Publishing angular-cli component library to npm or like

I've found a lot of blog posts that seem to suggest publishing a library TypeScript (as source) and all to npm or to a private repository. It feels like we should be doing some transpiling first and ...
3
votes
0answers
4k views

Angular UI Datepicker Popup with Default Time

I need to set date and time (12 hours 0 minutes) via Angular UI DatePicker Popup. plunker I had two issues: 1. When page was loaded: Input had value 17-March-2017 12:00:00.000. It's right. But ...
1
vote
1answer
39 views

How to refactor / re-architect the components/state here in ui-router app [closed]

https://plnkr.co/edit/bOZW1a9u62W1QA6cYjYj?p=preview My goal has been to separate the Dashboard states from the Feed state. ...
3
votes
0answers
138 views

AngularJs: Preventing multiple $q.get() per url

I've wrote a pretty useful method to prevent multiple requests per single get url. There is a well known pattern - to store promise and return it for each next ...
4
votes
1answer
814 views

Handling combinations of optional parameters for an Angular filter pipe

This is a simple implementation of an ng2 filter pipe, which can currently take 2 optional facets: <string>status and ...
1
vote
1answer
287 views

ToDo App in AngularJS

I have written a todo list app. I want to understand how to improve it. Here's what I'm trying to understand: My problem is when user clicks on task to edit, because it passed by reference, so if ...
1
vote
1answer
36 views

Taking objects from literal with many objects

I have data returned from an API coming back in a response: response.data ...
1
vote
0answers
35 views

Nodejs Read and replace into file

I wrote a function to read and replace words by words written in a form in angularjs. I would like to know your opinions to optimize it Knowing that I have to perform the changes in two files. ...
-1
votes
1answer
212 views

AngularJS calendar directive

Is adding CSS to template via <style> the right approach? How should I structure the application? Plunker link to the code ...
3
votes
1answer
117 views

Struggling to unit test Angular, was this module the best approach?

As a development team we've recently started to transition from MVC to Angular. None of us have had prior experience with it so a lot of creating the new client was very much trial and error. I've ...