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
0
votes
0answers
3 views
Pass scope variable over to new view
I would like to pass a specific variable on to a new view in angularJS.
This is what I am trying to do:
$scope.login_username_model = $scope.register_username_model;
$location.path('/confirmation');
...
0
votes
0answers
7 views
calling external api with AngularJS and ngResource
we are currently developing a little AngularJS project and starting from the frontend, so pure HTML and JavaScript.
However, we need to make some API calls using ngResource. At the moment we are ...
0
votes
0answers
13 views
Why is scope.$watch not triggered when a value is set via $parse assign in Angular?
I have two directives. One directive show a dropdown and the other directive must hide the dropdown when somewhere else on the page is clicked.
dropdown directive:
app.directive('dropdown', function ...
0
votes
0answers
15 views
Extending directives in AngularJS (sharing properties before and after link)
I have a directive which creates a rich text editor in its LinkingFunction. The small directive I'm using for my rich text editor can be found at ...
0
votes
0answers
21 views
What is angular way to transform a table cell
The problem is as follows. I have a directive which builds some table, and i use ng-repeat to construct table rows dynamicly. Each row has two buttons for editing and deleting accordingly. I look for ...
0
votes
1answer
20 views
when (or not) is a property created in an controller's scope?
I have two text inputs, one in root scope, and the other in a controller's scope,
<input type="text" ng-model="message">
When I give "q" in the first input, there is a property "message" ...
0
votes
0answers
4 views
AngularJS : How to mock a FormController injected in scope?
I have some validation logic happening inside a controller and I'd like to unit test this logic.
The thing is I don't know how to mock the form controller that is automatically injected into the ...
0
votes
0answers
15 views
How would I call a global function callback in the scope of a angularjs controller?
I'm trying to create something like this g+ login directive, which essentially adds something like
<span id="signinButton">
<span
class="g-signin"
data-callback="signinCallback"
...
0
votes
0answers
21 views
angular.js: How can I automatically add labels to input fields?
I'm working on a bigger project with angular.js. Therefore, I want to make the work for a single form as easy as possible. As we're also using bootstrap, the code for a single input field in a form is ...
0
votes
0answers
8 views
Angularjs how can I unit test a Service which depends on another Service with promises?
How can I test a service which depends on another service. I currently get Service1Provider not found error in this implementation. How can I properly inject Service1 so I can unit test Service2? ...
0
votes
0answers
15 views
Bind ng-click function in compile with AngularJS
When we try to add an ng-click function (linked to a controller action) onto an element during the compile phase, it is not working.
We can get it working if it is in the link function, but as we ...
0
votes
2answers
31 views
How to set the value of an attribute in Angular?
In my directive I have this code:
// hide all drodowns with this attribute
$(document).find('[dropdown]').each(function (index) {
if ($(this).is(':visible')) {
var a = ...
0
votes
1answer
40 views
Using AngularJS how could I randomize the order of a collection?
How would you order a list of items in AngularJS in random order? I was thinking that the built-in orderBy filter would work but I'm not sure how without adding some additional data to the model. ...
0
votes
1answer
16 views
MultiBar chart with nvd3 / d3 only shows labels for every other tick on the x-axis. How can I get them all to show up?
Data:
nvd3TestData = [
{
values:[
{x:"M",y:1},
{x:"T",y:2},
{x:"W",y:3},
{x:"R",y:3},
{x:"F",y:4},
{x:"S",y:5},
...
0
votes
3answers
35 views
Make another field invalid while validating
I'm dealing with a standard "change your password" form where you have two fields: password1 and password2. Those two fields are just to validate that the user enter the right password and they need ...