Allow template in addition to templateUrl

Probably not useful for most people but I needed it in my project.