Christopher Stephenson
Christopher Stephenson

Reputation: 502

Problems including bower installs in layout.jade

I am fairly new to the mean stack, and when I switch from importing angular from cdn to bower in layout.jade my app stopped working. I am getting a "ReferenceError: angular is not defined" and 404s for all the sources I am trying to import.

This is how my layout.jade looks(I also tried ../ and ../../ in front, but got the same results):

doctype html
html(ng-app='RIThym')
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
    script(src='bower_components/angular/angular.js')
    script(src='bower_components/angular-resource/angular-resource.js')
    script(src='bower_components/angular-route/angular-route.js')
    script(src='bower_components/angular-ui-map/ui-map.js')
    script(src='/javascripts/RIThym.js')
  body
    block content

This is my project structure:

bin

bower_components

node_modules

public

routes

views

layout.jade

app.js

package.js

Upvotes: 0

Views: 27

Answers (1)

Artur Górski
Artur Górski

Reputation: 2443

I assume that public_html is root directory for your webserver. In that case server doesn't have access to bower_components directory. And won't return anything from bower_components.

To solve this move bower_components directory to public_html.

Upvotes: 1

Related Questions