Joe Isaacson
Joe Isaacson

Reputation: 4132

Is there a directory file that dictates the structure in the angular-seed example?

I am new to angular JS and have been going through angular-seed, a clean angular JS app example, but noticed that the ref paths do not follow the file structure.

The example in case is the config routing below, with the below file structure:

config(['$routeProvider', function($routeProvider) {

  $routeProvider.when('/view1', {
    templateUrl: 'partials/partial1.html', 
    controller: 'MyCtrl1'
  });

}]);

File structure of the seed app directory

/app
--/css
--/img
--/js
---app.js (file that contains the above code snippet
--/lib
--/partials
--index.html

Shouldn't the templateURL path be '../partials/partial1.html'? Is there some file somewhere overriding this?

Upvotes: 0

Views: 64

Answers (1)

idursun
idursun

Reputation: 6335

No. templateUrl requests are going to be handled by the server. It might be mapped to a different route. For example static files might be under partials but the request might have to be something like http://example.com/public/partials/partial1.html

So it doesn't have to correlate with the project structure.

Upvotes: 1

Related Questions