I am looking to know if there is a way to perform a button click automatically on an angularjs page once the page loads based on a querystring value. For example in a simple asp.net web forms page if a querystring in a url is true then I can simply call Button1_Click(sender,e);
to handle the click event in the page load. But this HTML5 page uses angularjs and I just cant seem to figure out how to do it. Any help would be highly appreciated.
EDIT: Maybe I wasnt clear enough in my explanation...my bad. But here goes..This is what I intend to do.[Since I cant post pictures yet...]
http://host/app/Quik.aspx?Order=5779809
UI:
TxtLookupNum: {{InputValue}} DdlWMS:{{WMSKey}} DdlWsNum: {{WorkStationName}}
btnLookup:Submit
Angular code:
$scope.Lookup = function(WMSKey,InputValue,WSNum);
When my aspx page has a query string parameter I'd like to automatically trigger a click event and pass the 3 parameters to my angular method like above.
This is how I wrote it and it worked but:
var inputVal = $('#txtLookupNum');
if (inputVal.val() != "") {$("#btnLookup").trigger("click");}
But now I am getting the below error:
TypeError: Cannot read property '0' of undefined [after stripping out all the stack trace]