this question might be a bit old. buit it can be useful to someone else.
Use your Angular 4 as Front end alone, and let your Beego app to act like an api.
create an angular 4 app somewhere in your dev's folders. and create an go app inside your source folder. I have same set up as you trying to do.
and if you want them to act as in the same domain name. you can refer into this nginx server block.
server {
listen 80;
server_name example.com;
add_header 'Access-Control-Allow-Origin' '*';
## This is your Angular 4 app
location / {
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:4200/;
}
## This is your beego app
location /api/ {
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:9999/;
}
access_log /some/folder/example.com.access.log;
error_log /some/folder/example.com.error.log;
}