question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$event is undefined

See original GitHub issue

In following code, event passed properly but got undefined.

<select chosen  ng-change='fnSelectitem ($event)'>
                                <option value="">Select Account</option>
                                <option ng-repeat="ac in arrCustUUID track by ac.UUID" value="{{ac.CustAC}}" >{{ac.CustAC}} - {{ac.CustName}}</option>
                            </select>

$scope.fnSelectitem = function (e){ 
            e.preventDefault() // e is undefined here 
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
catch-shailendracommented, Sep 22, 2016

@leocaseiro got your point thanks for plunker link.

0reactions
leocaseirocommented, Sep 22, 2016

I hope works for you 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why the event object is undefined in my case - Stack Overflow
When you register an event handler inline, it can be given the Event object with the event parameter. This will not be done...
Read more >
How to Fix ReferenceError: Event is Not Defined in JavaScript
The Javascript ReferenceError occurs when referencing a variable that does not exist or has not yet been initialized in the current scope.
Read more >
event.target.name is undefined: What you need to know
You're likely getting this error because you're trying to get a name attribute on elements that don't have a name attribute. For example;...
Read more >
Event is undefined - Laracasts
Hi everyone, Again, I have an issue with vue.js 2. I have a code, where on right mouse click on element, I send...
Read more >
Deal with Undefined 'this' in React Event Handlers Correctly
When teaching React to developers, one thing that comes up often is dealing with a common error. In this post, learn how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found