Q:

render seo meta tags on server with servicestack angular 2 template

Servicestack angular 2 template have only one entry point - inxed.html. 
Let's say we want to have seo meta tags rendered on server for SEO optimization for route like /product/id.  Any ideas how to make it? 

A:

ServiceStack's Single Page App templates as the name suggests only runs from a single server index.html page.  This means that all the routing are performed on the client (i.e. browser) in Angular JS. 
This means that when the client navigates to a different page on the website, e.g. to /products/1 the request is handled by Angular client-side routing to load the configured component, i.e. the request never reaches the server. 
But when an initial request is made to /products/1, the request is sent to the server, but in order for Angular to be able to handle the routing on the client, ServiceStack returns the index.html home page, which it does for any unmatched requests using a FallbackRoute that's configured in the Template's MyServices class, e.g
[Exclude(Feature. Metadata)]
[FallbackRoute("/{PathInfo*}")]
public class FallbackForClientRoutes
{
    public string PathInfo { get; set; }
}

public class MyServices : Service
{
    //Return index.html for unmatched requests so routing is handled on client
    public object Any(FallbackForClientRoutes request) =>
        new HttpResult(VirtualFileSources. GetFile("index.html"));
}

In order to be able to return a modified index.html page you can just create a route that matches the request you want to handle, e.g:
[Exclude(Feature. Metadata)] //Hide Route from metadata pages
[Route("/product/{Id}")]
public class ViewProduct
{
    public int Id { get; set; }
}

and return a modified index.html page replacing a place holder in your page with the metadata you want, e.g:
[AddHeader(ContentType = MimeTypes. Html)]
public object Any(ViewProduct request)
{
    var indexFile = VirtualFileSources. GetFile("index.html");
    var html = indexFile. ReadAllText();
    return html. Replace("meta name=\"description\"", 
       $"meta name=\"description\" content=\"Product #{request. Id}\"");
}

To tell Webpack to include your custom place holder when it generates the index.html you need to modify the index.template.ejs template, e.g:
<! DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description">
 ...

