Tag: angularjs

52 votes
7 answers
2.2K views
When to favor ng-if vs. ng-show/ng-hide?

I understand that ng-show and ng-hide affect the class set on an element and that ng-if controls whether an el

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
64 votes
10 answers
3K views
What is the difference between Polymer elements and AngularJS directives?

On the Polymer Getting Started page, we see an example of Polymer in action: <html> <head>

avatar
Roger
0 1 0 9
asked 07 September, 2021
67 votes
6 answers
3K views
Link vs compile vs controller

When you create a directive, you can put code into the compiler, the link function or the controller. In the

avatar
Elicia
0 1 0 9
asked 07 September, 2021
57 votes
24 answers
3K views
Combating AngularJS executing controller twice

I understand AngularJS runs through some code twice, sometimes even more, like $watch events, constantly check

avatar
Sachiko
0 1 0 9
asked 07 September, 2021
62 votes
8 answers
1.4K views
What&apos;s the difference between ng-model and ng-bind

I'm currently learning AngularJS and am having difficulty understanding the difference between ng-bind an

avatar
Jeff
0 1 0 9
asked 07 September, 2021
58 votes
27 answers
431 views
How do I set the value property in AngularJS&apos; ng-options?

Here is what seems to be bothering a lot of people (including me). When using the ng-options directive in Ang

avatar
Gigi
0 1 0 9
asked 07 September, 2021
53 votes
11 answers
2.8K views
Adding multiple class using ng-class

Can we have multiple expression to add multiple ng-class ? for eg. <div ng-class="{class1: expressionData

avatar
Don
0 1 0 9
asked 07 September, 2021
59 votes
14 answers
3K views
Can one AngularJS controller call another?

Is it possible to have one controller use another? For example: This HTML document simply prints a message d

avatar
Hallie
0 1 0 9
asked 07 September, 2021
61 votes
7 answers
1.7K views
AngularJS passing data to $http.get request

I have a function which does a http POST request. The code is specified below. This works fine. $http({ u

avatar
Robt
0 1 0 9
asked 07 September, 2021
56 votes
20 answers
427 views
Confused about Service vs Factory

As I understand it, when inside a factory I return an object that gets injected into a controller. When inside

avatar
Yolando
0 1 0 9
asked 07 September, 2021
63 votes
15 answers
2.3K views
How to use a filter in a controller?

I have written a filter function which will return data based on the argument you are passing. I want the same

avatar
Royal
0 1 0 9
asked 07 September, 2021
59 votes
26 answers
3.1K views
Why does AngularJS include an empty option in select?

I've been working with AngularJS for the last few weeks, and the one thing which is really bothering me i

avatar
Sena
0 1 0 9
asked 07 September, 2021
53 votes
29 answers
433 views
How do I bind to list of checkbox values with AngularJS?

I have a few checkboxes: <input type='checkbox' value="apple" checked> <input type='c

avatar
Dwain
0 1 0 9
asked 07 September, 2021
60 votes
9 answers
3K views
How to iterate over the keys and values with ng-repeat in AngularJS?

In my controller, I have data like: $scope.object = data Now this data is the dictionary with keys and values

avatar
Keila
0 1 0 9
asked 07 September, 2021
59 votes
15 answers
1.5K views
How do search engines deal with AngularJS applications?

I see two issues with AngularJS application regarding search engines and SEO: 1) What happens with custom tag

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
56 votes
10 answers
2.2K views
if else statement in AngularJS templates

I want to do a condition in an AngularJS template. I fetch a video list from the Youtube API. Some of the vide

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.6K views
How to set focus on input field?

What is the 'Angular way' to set focus on input field in AngularJS? More specific requirements: Wh

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
56 votes
17 answers
707 views
Insert HTML into view from AngularJS controller

Is it possible to create an HTML fragment in an AngularJS controller and have this HTML shown in the view? Th

avatar
Keith
0 1 0 9
asked 07 September, 2021
55 votes
28 answers
2.2K views
AngularJS : Prevent error $digest already in progress when calling $scope.$apply()

I'm finding that I need to update my page to my scope manually more and more since building an applicatio

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
57 votes
12 answers
2.6K views
Working with $scope.$emit and $scope.$on

How can I send my $scope object from one controller to another using .$emit and .$on methods? function firstC

avatar
Don
0 1 0 9
asked 07 September, 2021