Tagged Questions
0
votes
2answers
49 views
AngularJS ng-click only working on second click
Attempting to collapse a dropdown menu (language selection), within a mobile bootstrap navbar. On first click, the dropdown menu with the languages opens fine, after changing languages the dropdown ...
1
vote
0answers
9 views
After mdBottomSheet hide its remove ng-click fire
i insert in my code mdBottomSheet show and button that open it.
this is my mdBottomSheet code:
$scope.selectPhoto = function () {
var options = {
templateUrl: 'student-details/camera-buttons....
-2
votes
2answers
137 views
Call a method only if my $scope variable is false
I've a div on click of which I'm calling a method.
Now, there's a 'Cancel' button, on click of which I'm setting a $scope.variable to true.
Next, I need to execute my function on click of the 'div', ...
1
vote
1answer
72 views
Finding scope inside ng-repeat for ng-click
I have a very complex nested angular object.
Now at the end of the object ng-click didn't work.
I read on how angular scope works, and I get that ng-click create a child scope for each item in the ...
0
votes
1answer
49 views
How do you fire a button click that does different things based on which Controller is on the view?
QUESTION
How do you fire a button click that does different things based on which Controller is on the view?
SITUATION
Below I have two directives/controllers that share the same template view. All ...
1
vote
1answer
78 views
Changing value of $scope on ng-click with ui-sref
This is absolutely killing me.
This is where I'm at:
And when I arrive to this page it prints this into the console:
Then I click on lorem2 which as a ng-click thats supposed to change the ...
0
votes
1answer
98 views
attach onclick/ng-click event to element in grid databound event
I have a TypeCtrl ES6 class angular controller which uses a kendo datagrid directive and has template for grid config options , In the template for the grid, i need to call a method from the TypeCtrl ...
0
votes
1answer
189 views
Two way binding for ng-click directive in angularjs
I have calling a function in two elements. when I triggering the function an on-click event then also it should be hit once more time for wherever I called that function.
//html
<button type="...
1
vote
0answers
341 views
Again: ng-click not working inside ng-repeat inside ng-if
This is most likely going to be another Angular scope question. I looked hard for a solution on SO, however, nothing I found would solve my problem.
I am using Angular.js together with Swiper.js. ...
0
votes
1answer
136 views
Laravel parent variable ng-click
I am having troubles with Angular in Laravel. I am trying to change a variable by clicking on a button.
For this I wrote the following code:
<div class="user-team-navigation col-sm-12" id="user-...
1
vote
1answer
91 views
How To Pass Template-Defined Variable to Angular Controller
This question is a long overdue extension of Angularjs How to pass parameter back to controller from directive with ng-click in which strings are able to be passed to an Angular controller, but ...
0
votes
2answers
2k views
How can I change URL from $scope in AngularJS?
I have made access navigation with $scope and I used them based on click and I did. I can't set URL in variable accommodate. The correct URL is http://www.example.com/base/index or http://www.example....
0
votes
0answers
72 views
Angular two forms, two ng-click, same function, only the first one runs
I have two forms on a page. The first adds an item to the database, and the second is prepopulated with the data and allows the user to modify the item. The first form allows the user to create and ...
1
vote
1answer
37 views
AngularJS model update reverting back to original
http://plnkr.co/edit/3UMwSK6H5VL0pZujL7Qh?p=preview
Click edit and then cancel. The text boxes do not go away. Click cancel again, they go away. Please tell me why this is happening. I am losing my ...
0
votes
2answers
367 views
Toggle two classes with AngularJS / jqLite on click
I wan't to get a slideIn / slideOut animation by toggling the classes slideInRight and slideOutRight to a ul element.
I've tried it in different ways but I it only works with one className.
How ...
0
votes
2answers
54 views
Not able to change path using $location service even after using $scope.apply
I am wondering why I am not able to change my view using location service even after I use -
$scope.$appy() or $scope.apply;
I did research before posting my question. I got results of similar ...
0
votes
0answers
292 views
Angularjs ng-click doesn't work inside scope (Firefox only)
I just play around with angularjs and its functions. I simply try to click a button and return a string in console.log. When I click the button, nothing happens even no error message is visible. What ...
0
votes
2answers
293 views
Comparing objects from two scopes to provide a value
I'll try to simplify the problem as much as I can.
Let's say I have 2 scopes
$scope.section1 = [
{label: 'label1'},
{label: 'label2'}
];
$scope.section2 = [
{value: 'one'},
{value: 'two}
];...
0
votes
2answers
423 views
auto generate download link with angularjs
i generate my download link from this script
https://github.com/joshpangell/single-use
for example:
download url generated like this:
http://cloud.joshpangell.com/singleuse/download.php?key=...
2
votes
1answer
78 views
Ng-click filter between 2 scopes
I am new to Angular.js so I am not sure if this is the right approach. I have two scopes that are used to display 2 sets of buttons. The second set should be dependent on the button I click in the ...
0
votes
1answer
38 views
get data from a ngrepeated div to another div on click
<div ng-app="appPage" ng-controller="appController">
<div class="nav">
<h1 class="logo">Todlio</h1>
<a href="setting.html"><i class="icon setting" ...
0
votes
2answers
543 views
Get the ID of clicked button only in Angular Js
In the snippet bellow, if you click one of the buttons, then all three buttons will re-act and rotate with the clicked one.
How can I rotate only the clicked one? I tried to pass unique id of each ...
0
votes
4answers
980 views
how to use dynamic variables on ng-click angular?
Well, I don't know how I can use "dynamic" variables on ng-click attribute.
In this case, i want update variable from reference in ng-click ng-if etc.
My idea is update variables from reference and ...
0
votes
2answers
333 views
Apply $scope ng-click event to hidden element after it is displayed
Please ask me for better explanation. I have built a global search function into the header of my site. I want to display a separate input box for mobile search that uses the same ng-click event but ...
2
votes
1answer
357 views
applying class using ng-class for nested items in Angularjs
I am displaying the menu items in the below format. The data contains list of items and for each item there is a subitem. I need to apply the selected class for the subitem selected and all other ...
1
vote
5answers
1k views
updating single item when using Angularjs ng-repeat
I am listing the elements from an array defined inside my controller on the view using ng-repeat. Each item has an edit and cancel button.
<div class="portlet-body" dir-paginate="item in keys>
...
1
vote
2answers
4k views
Typeerror - Not a function in angular directive
I have defined a custom click directive as below:
(function() {
'use strict';
angular.module('myApp.core')
.directive('customClick', customClick);
customClick.$...
3
votes
1answer
476 views
Ng-show will not update when ng-click is inside div
I have a DIV with ng-show.
When I run ng-click on an element outside of the DIV, it works fine and I can hide it.
When I run ng-click on an element inside of the DIV, it does not work. I can see ...
-1
votes
1answer
2k views
Linking one controller to another to call service on ng-click
I have two templates with respective controllers and service files. One template's(fleetListTemplate) controller(fleetListController) loads data from its service file(fleetService) and displays in ...
4
votes
3answers
1k views
Angular scope and ng-click / ng-show to set multiple divs
I am looking for some help with my code I have so far.
The main objective is to be able to click on any Plus icon and have it place a cover over all other div blocks.
And when a plus icon is ...
3
votes
3answers
10k views
Clear ng-model value in controller after ng-click
I need to change the ng-model value to empty after ng-click
My code:
<div class="desc-gestures-comment ind-row">
<textarea id="txtCommentArea" class="comment-box text-comment-listing" ...
0
votes
1answer
3k views
How to Pass Scope Variable in ng-click and how to access the Parameter in angularJS Function within Controller
How to Pass Scope Variable in ng-click and how to access the Parameter in angularJS Function within Controller ?
My Source Code is
<!DOCTYPE html>
<html>
<script src="http://ajax....
0
votes
1answer
104 views
Running a controller with ng-click
.controller('randomImageController', function($scope, $http, Image) {
$scope.loading = true;
Image.random()
.success(function(data) {
$scope.image = data[0];
$scope.loading ...
3
votes
2answers
3k views
Change $scope value when a ng-click function is triggered
I tried to change a $scope variable in angularjs ng-click function. But angularjsdoes not seem to be able to do that.
Below is my code on my appController:
// appController.js
$scope email = "...
2
votes
2answers
992 views
Angularjs - set value ng-click inside ng-repeat on an item
I load quite a few videos on the page, from youtube. I want to replace the div with placeholder, and only request the video when user clicks on the placeholder image.
I got this part working where it ...
2
votes
3answers
178 views
Understanding scope, ng-click and the angular-way
While working on the phone tutorial i wondered how to implement this use case
user clicks on add phone
the function addItem is fired and the phone.id is passed
the relevant phone is retrieved ...
0
votes
2answers
483 views
AngularJS Button to reload state does not work
I want to have a button on the front end (AngularJS) that refreshes the changes made to the database. I have tried the following in the html:
<button ng-click="reloadState" data-translate> ...
4
votes
1answer
2k views
AngularJS - how to trigger filter on ng-click
I'm trying to make simple multi-language website.
I have a small controller just to be able to change current language in root scope:
app.controller('Ctrl', function($scope, $rootScope) {
$...
1
vote
1answer
3k views
ng-click value change + $scope.watch bind not working properly
I have a scope variable '$scope.searchType' which is equal to 'createdAt' by default. In my HTML I have options that change the scope variable value:
<ul class="dropdown-menu" role="menu">
&...
1
vote
1answer
565 views
How to prevent a ng-click event on a div in a sub controller from triggering an ng-click in the root?
http://plnkr.co/edit/gB7MtVOOHH0FBJYa6P8t?p=preview
I have a parent child controller example above, in the child when a button is clicked I displays the div showPop and then will $emit an event ...
1
vote
1answer
58 views
How to close out all popovers on body click in Angular?
http://plnkr.co/edit/hqXGl47EJ0wVaEgoXk3X?p=preview
I'm trying to find the best way to accomplish this. Basically there are several popovers we have in our app, for fuzzy search, additional options, ...
3
votes
2answers
87 views
Method display on the scope is not executed
I have a set of directives that share a scope
Update:
The code is available as a plunk here http://plnkr.co/edit/JZ77bsZgGrw6N4K718Is?p=preview
todo-item:
app.directive("todoItem",function(...
1
vote
2answers
4k views
Switching between tabs in modal in angular
I have a login and a signup form that opens in a modal. At the top I have two tabs switching between login and signup. see picture
Switching between the tabs works fine. However, I want the user to ...
2
votes
1answer
1k views
Using ng-click inside np-repeat
I'm trying to implement a shortlisting functionality in a case where I'm using ng-click inside ng-repeat.
While the $index is being displayed correctly outside the ng-click, $index is only the index ...
0
votes
1answer
2k views
ng-repeat with ng-click inside a directive
I am trying to create a simple autocomplete tag directive. But the ng-click on the dropdown menu <li> won't fire. I am sure this is some sort of scope issue, but I don't get why. Can someone ...
-2
votes
1answer
804 views
How to trigger ng-click inside ng-repeat angularJS
ng-click does not work inside ng-repeat. I have read all the guides and similar questions, but nothing work in my code. If I click on the tag inside the ng-repeat nothing happen, but if I click on my ...
13
votes
2answers
28k views
AngularJS pass string as function to use at ng-click
I want to assign a javascript function to ng-click which name is sourced by a rest service.
<li ng-class="{ active: isActive('url')}" data-ng-repeat="menu in mb.data">
<a href="{{menu....
2
votes
3answers
40k views
angular js - using ng-click to focus on a text box
I'm trying to build an Angular JS form. I'd like user to be able to set the focus on a text field when they click a button. Not sure why this doesn't work? Thanks
html:
<div ng-app="" ng-...
0
votes
0answers
179 views
Sharing data between controllers in AngularJS (PubSub/Event bus example)
I have a page with a list of product. I have a li with my directive that it does is that when I click on a link it is inside of the li and compiled a template inside of the li and show my template.
...
1
vote
2answers
294 views
Using $compile in services asking for scope
Can i use $compile in the services as it is throwing error scope doesn't exist.
services.factory('getRegistersrvs', function($http, $compile) {
return {
getRegisterpage: function() {
...