1

It does not work with the specified templateUrl: test.html but works if you specify the template: 'Hello '

WORK

app.config(function($routeProvider){
    $routeProvider
    .when('/test', {
        template: '<h1>home</h1>',
        controller: 'ctrl'
    })

    // .otherwise({
    //  redirectTo: '/home',
    //  controller: 'ProductCtrl'
    // });
});

DO NOT WORK

app.config(function($routeProvider){
    $routeProvider
    .when('/test', {
        templateUrl: 'test.html',
        controller: 'ctrl'
    })

    // .otherwise({
    //  redirectTo: '/home',
    //  controller: 'ProductCtrl'
    // });
});

and I have a sign ! in the path to the file that is #!/test

LINK

<a style="color:white;" href="#!/test">Go</a>

I'm using nw.js

2

1 Answer 1

1

You could try to put a path to your template url

.when('/test', {
   templateUrl: './test.html',
   controller: 'ctrl'
  })
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.