spModal - prompt(String message, String default).then(fn)

Displays a prompt for user input.

Table 1. Parameters
Name Type Description
message String The message to display.
default (optional) String A default value to use if the user does not provide a response.
Table 2. Returns
Type Description
String The promise contains the user's response, or the default value if the user does not enter a response.
//HTML template
 <button ng-click="c.onPrompt()" class="btn btn-default">
    Prompt
  </button>
  <div ng-show="c.name">
    You answered <span>{{c.name}}</span>
  </div>

// Client script
function(spModal) {
  var c = this;
  c.onPrompt = function() {
        spModal.prompt("Your name please", c.name).then(function(name) {
            c.name = name;
        })
    }
}