mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-29 21:37:00 +08:00
fix(docs): change plnkr form to open in same window
Form previously posted to target="_blank", but pop-up blockers were causing this to not work. If a user chose to bypass pop-up blocker one time and click the link, they would arrive at a new default plnkr, not a plnkr with the desired template. This fix removes the _blank target, causing the plnkr to open in the current window/tab.
This commit is contained in:
@@ -2,7 +2,12 @@ angular.module('examples', [])
|
|||||||
|
|
||||||
.factory('formPostData', ['$document', function($document) {
|
.factory('formPostData', ['$document', function($document) {
|
||||||
return function(url, fields) {
|
return function(url, fields) {
|
||||||
var form = angular.element('<form style="display: none;" method="post" action="' + url + '" target="_blank"></form>');
|
/**
|
||||||
|
* Form previously posted to target="_blank", but pop-up blockers were causing this to not work.
|
||||||
|
* If a user chose to bypass pop-up blocker one time and click the link, they would arrive at
|
||||||
|
* a new default plnkr, not a plnkr with the desired template.
|
||||||
|
*/
|
||||||
|
var form = angular.element('<form style="display: none;" method="post" action="' + url + '"></form>');
|
||||||
angular.forEach(fields, function(value, name) {
|
angular.forEach(fields, function(value, name) {
|
||||||
var input = angular.element('<input type="hidden" name="' + name + '">');
|
var input = angular.element('<input type="hidden" name="' + name + '">');
|
||||||
input.attr('value', value);
|
input.attr('value', value);
|
||||||
|
|||||||
Reference in New Issue
Block a user