I have created a directive for my angular app, in the directive I am using templateUrl to get the template.
templateUrl: 'templates/searchbox-template.html',
This worked fine on my local server but when I host it on firebase it gives this warning repeatedly-
WARNING: Tried to load angular more than once
Also the page gets stuck in a loop, repeatedly adding index.html to page. You can see the app here, if you go to the companies or jobs tab from the navigation bar which is where I have used the directive. I am not able to figure out what path should I use to stop this. Here is the structure of the app -
.
├── app
│ ├── 404.html
│ ├── favicon.ico
│ ├── images
│ ├── index.html
│ ├── robots.txt
│ ├── scripts
│ ├── styles
│ ├── templates
│ └── views
├── bower_components
│ ├── angular
│ ├── angular-mocks
│ ├── angular-route
│ ├── animate.css
│ ├── bootstrap
│ ├── jquery
│ └── jssocials
├── bower.json
├── dist
│ ├── 404.html
│ ├── favicon.ico
│ ├── fonts
│ ├── index.html
│ ├── robots.txt
│ ├── scripts
│ └── styles
├── firebase.json
.
├── app
│ ├── 404.html
│ ├── favicon.ico
│ ├── images
│ ├── index.html
│ ├── robots.txt
│ ├── scripts
│ │ ├── app.js
│ │ ├── controllers
│ │ ├── directives
│ │ └── services
│ ├── styles
│ │ └── main.css
│ ├── templates
│ │ └── searchbox-template.html
│ └── views
│ ├── about.html
│ ├── companiesall.html
│ ├── company.html
│ ├── contact.html
│ ├── jobsall.html
│ └── main.html
As you can see my template is in the templates folder. Please help me with this. Thank you.
Update - Accoring to this answer , the directive is not able to find the template hence loads the index.html again and again because of this -
.otherwise({
redirectTo: '/'
});
I just need to figure out the right path for the template.
This is contents of firebase.json json file -
{
"hosting": {
"public": "dist",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}