separ1 separ1 - 9 months ago 50
AngularJS Question

How to add focus on the cancel label of the popup?

I have this popup function. It has a template for the pop up. Has one delete and cancel button. I want to have focus on the cancel button when the popup opens. How can i do that?

$scope.Popup = function(funcname){
id: '',
title: '',
scope: $scope,
template: '<div class=""><span>Delete the selected item?</span></div>',
success: {
label: 'Delete',
fn: function(){
//Do Something
cancel: {
label: 'Cancel',
fn: //Do Something


Answer Source

Versions of JS differ you may or not need the # to identify the object.