Question: So I've been looking at this for way too long. Really hope someone could help me out :) I'm just trying to create a module that creates a directive and controller for my site header in AngularJS. I don't get any error and the log in my code won't show up. This is the code related to the header module:

**header/header.js**

```
 'use strict';
angular.module('myApp.header', [])

.directive("headerBar", [function(){
  return {
    restric: "E",
    templateUrl: "header/header.html",
    controller: 'HeaderCtrl'
  };
}])

.controller('HeaderCtrl', ['$log', function($log) {
  $log.log('test header controller');
}]);

```

**app.js**

```
angular.module('myApp', [
  'ngRoute',
  'myApp.header'
]).
config(['$routeProvider', function($routeProvider) {
  $routeProvider.otherwise({redirectTo: '/'});
}]);

```

**index.html**

```
<script src="header/header.js"></script>

<header-bar></header-bar>

```

Answer: 
Fastest and best way to change the URL is to go to the *wp-config.php* File and place this code:

```php
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

```
You have to be very careful about the search and replace and ensure that any serialized data in any of your tables is properly unpacked, updated and re-packed.

If your target site is usable you can use various things to update its data to use the new URL format.

If you're comfortable with the command line you can use the [WP-CLI](https://wp-cli.org/) with a command like:

```
wp search-replace http://localhost:8080/wordpress http://localhost/wordpress

```

For a WordPress Admin Dashboard tool I'd recommend the free [Better Search Replace](https://wordpress.org/plugins/better-search-replace/) plugin.

If the URL needs to be changed before loading the data into the new site's database, I'd recommend using the free [WP Migrate DB](https://wordpress.org/plugins/wp-migrate-db/) plugin to export your database with a find/replace pair of "//localhost:8080/wordpress" and "//localhost/wordpress" (without quotes). You can then run the exported SQL file against your target site's database.