Ich habe eine sehr sehr einfache Anwendung, wo Sie Zeichenfolge Werte in zwei Eingabefelder eingeben und der Text in einem Satz platziert wird.Angular JS - Schalteingang Werte
Ich möchte eine Schaltfläche erstellen, die bei einem Klick mit den beiden Werten wechselt.
HTML
<body>
<div ng-app="myApp" ng-controller="myCtrl">
Old URL: <input type="text" ng-model="oldUrl"><br>
New URL: <input type="text" ng-model="newUrl"><br>
Prefix: <input type="text" ng-model="prefix"><br>
<br>
UPDATE {{ prefix }}_options SET option_value = replace(option_value, 'http://{{ oldUrl }}', 'http://{{ newUrl }}') WHERE option_name = 'home' OR option_name = 'siteurl';<br>
UPDATE {{ prefix }}_posts SET guid = replace(guid, 'http://{{ oldUrl }}','http://{{ newUrl }}');<br>
UPDATE {{ prefix }}_posts SET post_content = replace(post_content, 'http://{{ oldUrl }}', 'http://{{ newUrl }}');<br>
UPDATE {{ prefix }}_postmeta SET meta_value = replace(meta_value,'http://{{ oldUrl }}','http://{{ newUrl }}');<br>
</div>
</body>
JAVASCRIPT (Angular)
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.oldUrl= "oldurl";
$scope.newUrl= "newurl";
$scope.prefix= "wp";
});
Also, wenn Sie auf eine Schaltfläche klicken 'oldurl' und 'newurl' Schalter.
Jede Hilfe würde sehr geschätzt werden.
funktioniert perfekt! Ich danke dir sehr! –