-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: inputText option for $ionicPopup.prompt() #1589
Comments
Hey @danielzen, between the |
inputPlaceholder is only a placeHolder, not editable... PlaceHolder text gets immediately overwritten? I want to pre-populate the actual input value, not just a temporary one. I created a codepen to illustrate: |
PS: I tried to take advantage of the fact that I knew, under the hood, that data.response was the ng-model that prompt was using: http://codepen.io/danielzen/pen/kotEw However, this stopped the |
Ah, i see. I'll take a look. Thanks! |
@danielzen You can always use a template! For example: $scope.data = { text: '123' };
$ionicPopup.show({
templateUrl: "my-template.html",
scope: $scope
}); <script type="text/ng-template" id="my-template.html">
<input ng-model="data.text">
</script> |
Is a template really the only way to achieve this? I would have thought that something like that would already be implemented, in pretty much the exact way that @danielzen has described. Is it something that may be implemented in the future? |
The number of extra lines required for this common functionality seems @ajoslin: I do not believe your solution is complete. I have tried what you |
I think that this is a common enough scenario that this option should be added. Using a template seems like the opposite of 'brevity' in this case. |
I expected this option to be there, similar to ngCordova's defaultText for prompts. |
I keep thinking I'm going to just add the feature in myself, and make a This is the hack I have been using: https://github.com/danielzen/todo-ng-pouchdb/blob/master/www/js/app.orig.js $scope.editTask = function(task) {
$scope.data = { response: task.title }; // A hack to pre-populate prompt
$ionicPopup.prompt({
title: "Edit Task",
scope: $scope
}).then(function(res) { // promise
if (res !== undefined) task.title = $scope.data.response; // response not res has new title (hack)
$ionicListDelegate.closeOptionButtons();
})
};
})
|
I want to create an edit text prompt by pre-populating the input text:
instead in beta.6 I had to write :(
The text was updated successfully, but these errors were encountered: