1,085 questions
0
votes
1
answer
520
views
Cannot assign value "undefined" to template variable "buttonName". Template variables are read-only. Angular/TypeScript
So I want to say Im new for Angular.
app.component.ts;
model = new Model();
addItem(value:string){
if(value!="")
{this.model.items.push(new TodoItems(value,false));}
model.ts;
...
0
votes
1
answer
950
views
Angular click directive scroll to section of page within modal-dialog not working with dynamic content
Looking to scroll to page sections when user clicks using scrollIntoView in a modal with dynamic content.
I've tried using ViewChild, event emitting, and ngAfterViewChecked but no luck.
Code: https://...
0
votes
1
answer
106k
views
Angular.js unable to change scope variable value just after a different function call
I'm trying to implement a Refresh button for fetching latest search results from an external index. When I click on the Refresh button the icon is supposed to spin. My plan was to have a scope ...
1
vote
1
answer
106k
views
In an Angular.js controller's scope function code doesn't run below a $timeout statement inside
I have a button for which I have set ng-click="refresh()". The console logs before the timeout function logs correctly but the console log inside the $timeout block and after the block doesn'...
0
votes
1
answer
385
views
Capture Ng-click event from button inside the texteditor in text-angular
Use-case : User clicks on a button inside text angular textarea and applications angular function to be invoked
Changes made : We had added ng-click, onclick events in textAngular-sanitize.js refer ...
4
votes
1
answer
475
views
Python Selenium ng-click action
I've been searching for a solution here on Stackoverflow or Google, but unfortunately I couldn't find any solution.
I'm trying to do webscrape on a website, but I can not click on a button with Python ...
0
votes
1
answer
46
views
ng-click event not getting fired with ng-repeat in a table
below vm.onQRnClicked function is not getting fired from a ng-click in table. link for QRN column in table is being dynamically created from responses of API's. used ng-click to attach event.getWf, ...
0
votes
1
answer
77
views
show div depend on number of clicks using ng-show, ng-click, ng-init
I want to show one div by default. If a button clicked, show the second div and if it clicked again, show the third div.
I tried ng-if and ng-show and nothing happened.
<table class=""...
0
votes
1
answer
133
views
Angular JS ng-click not being triggered, using multiple controllers
I'm trying to get ng-click from one of my views to work globally.
I started with this Plunker
and I've looked at these answers already:
ng-click not firing in AngularJS while onclick does
Angular ng-...
0
votes
1
answer
71
views
how to change color Buttons once it is selected? and if input question
I have this code where I could only change the color once , i want the color of the selected button to change in each diffrent line.that in each line there will be only one button selected but for ...
0
votes
1
answer
652
views
ng-click and ng-init variable definition
I am trying to make table header sorter work by using ng-click and ng-init.
Examples in angular js documents require modules, and if I install and update that module, my SPA falls apart for some ...
0
votes
2
answers
1k
views
AngularJS - Toggle object value boolean on button click
I'm building a ToDo application to learn Angular JS.
In my app I have an array called toDoList, that I push objects into based on some inputs from the user, this is done elsewhere in a modal.
That ...
0
votes
1
answer
229
views
Click not working after html append using ajax in Kendo UI
I'm working in kendo UI & I'm facing an issue while I give an ng-click option on the HTML content which was loaded later.
Here I'm adding a few codes related to what I have did:
HTML:
<div ng-...
1
vote
0
answers
572
views
Scroll to ngFor angular item by clicking on another
i have list of contacts divide in alphabetical categories and another section contains alphabetical letters , like this image (image will help to understand my question) contacts list
to do that i ...
1
vote
0
answers
76
views
Rebind ng-click event
I implemented drag and drop directives which work on a button. In my drop directive I use preventDefault() which is needed for the functionality of dropping elements on the button. However, this ...
0
votes
1
answer
455
views
Alternative approach for multiple button click in angularjs
I am just wondering is there any better way to approach same kind of logic as below. 4 buttons onclick of it have to send parameters like (english, german, spanish, french) to angular function. Is ...
0
votes
3
answers
847
views
Angularjs: Why does it execute function in ng-if when I click on table row?
I have code on https://jsfiddle.net/8t45enfg/2/
The source code is quite simple, suppose the array list have only one element
HTML code:
<div ng-controller="myController">
<table>
...
0
votes
2
answers
97
views
Get all data from form by ng-click AngularJs
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script>
<div ng-app="myApp">
<div class="container" ng-controller="CtrlList">
<div ...
0
votes
1
answer
211
views
AngularJS - Selection of text triggers ng-click in parent in Chrome
I am experiencing a problem, to which I currently have no suitable solution:
Having an input field and when selecting the text and the mouse cursor is moved beyond the input field, the ng-click-event ...
0
votes
2
answers
85
views
Multiple function invoked from ng-click also using lazy evaluation
I've managed to disable ngClick on an element if a variable assigned to the scope (notInProgress) evaluates to true like so:
<a data-ng-click="notInProgress || $ctrl.setTab('renewal');</a>
I ...
1
vote
0
answers
68
views
When clicking the button to call the "hideProductIncentives" nothing is happening
The main issue I am facing here is that I have two divs and two directives that are nearly identical. The main difference between the two is that in one, most of the variables were changed to product, ...
1
vote
2
answers
116
views
Is it possible to store AngularJS functions in arrays and put the functions in ng-click?
I was trying to make a few buttons using Array. The buttons displayed, but the function from the array is not working.
var module = angular.module('app',[]);
module.controller('Ctrl',['$scope', ...
0
votes
1
answer
331
views
Is it possible to set switch button to true via function?
i got an switch button in my HTML part.It uses "checked ng-click",
"ng-modal" and uses the css class "switch" from https://material.angularjs.org/latest/demo/switch
So my problem is i ve got a ...
0
votes
1
answer
62
views
Why does ng-click not fire functions when inside ng-repeat, in AngularJS?
I am working on a small AngularJS application. In one of the views, I have replaced some hard-coded html with data coming from a JSON file that I iterate through:
<class="actions-list">
<...
0
votes
2
answers
211
views
Is it possible to add an ng-repeat $index value inside an ng-click with AngularJS?
In my HTML I have a dropdown list that I did with an ng-repeat.
Each of these elements needs to have their own function when clicked, so I'm using $index. Here's part of my code:
<div class="...
0
votes
1
answer
448
views
ng-click in directive seems to trigger only once
I am trying to implement a directive that replace a tag by a with ng-click in it.
The ng-click call a function that replace the content of a div (always the same) with the content of another ...
0
votes
0
answers
34
views
ngSanitize erases my ng-click, how would I use a directive to replace it? [duplicate]
I have seen many people ask this question, however the answers are so complicated that they do not make sense, neither do the fiddles. I am having an issue with ngSanitize removing my ng-click links ...
0
votes
2
answers
3k
views
angularjs ng-click "How can I use javascript's setAttribute() to create ng-click attribute with some function"
I would like to be able to select a button using querySelector and set an attribute of "ng-click=doSomething()"
I have tried selecting the button and then setAttribute("ng-click", "doSomething()") ...
0
votes
1
answer
379
views
Clicking on a button doesn't work after navigating back to the page
I have single button on a page. Clicking on that button navigates to a desired page. Problem occurs when I go back to previous page and when I click on a button nothing happens.
I observe that it ...
0
votes
1
answer
40
views
How to stop ng-click event and run it later by another custom directive
I need to animate each click on a website. So i created a derictive for this. But, not all events works fine, for example if it's ui-sref or ng-click event that changing state or opening a modal ...
-1
votes
2
answers
2k
views
XPath for the element with ng-click
I am trying to find a button and click on it. I am using selenium with c# and also have protractor. I am not able to find the element.
<button class="btn--primary quote-summary__card-btn" role="...
0
votes
1
answer
21
views
How to start a function from normal text (not a button)
I have a function that I can call from a button, but I need to call it from the text within a paragraph.
This works:
<ion-chip (click)="myFunc('text')">Do stuff</ion-chip>
async ...
0
votes
1
answer
173
views
ng-click doesn't invoke method inside angularJs controller
I am trying to create an angular application from scratch. I have been trying to solve this for hours now, but I couldn't make it work.
All the following files are placed inside a parent folder.
...
0
votes
1
answer
369
views
How to hide show div by using dynamic id in AngularJS
My code as below in html file:
<ul class="main-icons" ng-if="showMainIcons">
<li ng-repeat="programData in tab.data">
<img src="{{programData.icon}}"
ng-click="...
0
votes
1
answer
229
views
angularjs $window.onclick performs better than ng-click
I had a scenario where I have to make some alterations in localstorage as well as in some other data of the controller, this logic was supposed to be done on click of anywhere in whole page. This code ...
0
votes
1
answer
340
views
Custom Business Logic in today button of fullcalendar
I am using Angular JS and FullCalendar control for one of my requirement.
My code for full calendar in Angular JS is as below:-
<div ui-calendar="uiConfig.calendar" ng-model="eventSources" id="...
0
votes
3
answers
581
views
Call an AngularJS function on button click is not working
I have a requirement where I want to call an AngularJS function on button click. So I tried like below
var app2 = angular.module('grdContrl', ['datatables']);
app2.controller('dtAssignVendor', ['$...
1
vote
1
answer
506
views
How to Show and Hide My Image and Video Section Without ng-click in AngularJS
I am working online courses project. I have multiple courses fetch from data with the unique id. And My courses Id have images or video. When I clicked on my courses Id then it redirects to this page(...
0
votes
1
answer
53
views
AngularJS ng-click in <tr> to hide a form
I want to hide a form when you click on a tr of a table, using ng-click but when I click on the tr nothing happen,
This is the code i have:
<tbody ng-repeat="userf in user | filter:buscador as ...
0
votes
1
answer
230
views
AngularJs ng-click function getting runtime error - can't read property of undefined
Hi i am trying to run a function from my .js file by a button but when i click the button it is not responding and nothing is happening.
Html:
<html>
<head>
<script src = "...
0
votes
2
answers
271
views
$compile not triggering ng-click in angularjs
I am generating dynamic html element from angularjs controller.I have used $compile
to make ng-click work inside html element.But still it is not calling the function.
Here is my js
var ...
1
vote
1
answer
72
views
{{}} in ng-click & ng-repeat [duplicate]
This is the code of my HTML
<div id="container" ng-app="containArea" ng-controller="myCtrl">
<div id="sidebody" class="block">
<button
ng-repeat="shopli in shopName"
...
1
vote
1
answer
65
views
Flot legendFormatter is not working with ng-click
I am trying to create clickable legends. I am using flot chart and legendFormatter to manipulate the legends. Here is my code in js file:
$scope.labelFormatter = function (label, series) {
return ...
0
votes
1
answer
1k
views
Copy link address for anchor tag with ng-click and href="javascript:void(0)"
Sample Html
<a href="javascript:void(0)" ng-click="someFunction()" />
Controller will have the following function
someFunction() {
window.open('http://www.example.com');
}
When we click ...
0
votes
2
answers
118
views
ng-click HTML code works fine but same code in an angularjs function.ng-click does not working
HTML
<div id="rightpane">
<div id="rightpanecontent" >
<div id ="Addbtn" style="text-align: right;">
<button type="btnAdd" class="btnAddText" ng-click="addText()" ...
0
votes
1
answer
925
views
How to add corresponding classes to the body element when each radio button is clicked in Angular 6
I want to add a specific class to the body tag and active class to the parent element when I click on each radio buttons.
Eg:
<form action="">
<input type="radio" value="layout1">...
0
votes
0
answers
44
views
Loading ng-view html templates
I have one index.html page and I am using ng-view. The two HTML templates are page1 and page2.
I have a button to which I have attached an ng-click function. When the function is fired, I am fetching ...
0
votes
1
answer
631
views
Checking for URL.$valid (if then) inside inside AngularJS ng-click. How?
I am making a URL list inside an angular App, Most of the URLs all lead to https://example.io... However a select few have URLs such as https://example.io. I don't want to specify the URL inside every ...
1
vote
2
answers
138
views
Angular JS / PHP- can read data from database but ng-click not working
Now I can read the PictureName from database and show it on the browser. (Picture below: black block on the left)
And what I want to do is that, when do click on one of rows (ex: pic1), it will ...
0
votes
1
answer
1k
views
Filtering Images with Button Clicks AngularJS
I'm needing to filter images based on category in the model. I've created buttons for the category. E.g. if user presses Lake Pics button, would like it to filter all of the images with the category ...