Yeoman - Angular Material partial html template are not correctly loaded after grunt build

416 Views Asked by At

I've made an Angular Material web application using Yeoman as project starter. When I run

grunt serve

I can see the website in localhost correctly and everything is working. When I run:

grunt build

to build my web application, it finishes without any errors. After that, I upload the dist folder content to my online web server, but when I navigate to the web application, the partial template html I used in $mddialog are not loaded and i get this error:

GET http://my.website.url/views/dialogs/dialoginfodocument.html 404 (Not Found)
on file vendor.t3fefw.js

The $mddialog code is:

          $mdDialog.show({
            scope: $scope,
            templateUrl: './views/dialogs/dialoginfodocument.html',
            parent: angular.element(document.body),
            targetEvent: $event,
            clickOutsideToClose:true,
            preserveScope:true,
            useFullScreen: useFullScreen
          })

and the partial template html:

<md-dialog>  
<md-toolbar>.....</md-toolbar>
<md-dialog-content>....</md-dialog-content>
</md-dialog>

What I'm doing wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

Thanks to charlietfl comment I solved the issue. The problem was the leading ./ before html template url.