Alicia Sykes
Alicia Sykes

Reputation: 7077

Angular AOT compiler can't find project-relative paths within components

I'm in the (painful) process of AOT-ing an app I've been making, but have hit a bit of a hurdle when it comes to specifying URL's for the components.

Works in AOT, but not JIT 😖

@Component({
  selector: "home-page",
  templateUrl: "./home.html",
  styleUrls: ["./home.css"],
}) 

Works in JIT, but not AOT 😖

@Component({
  selector: "home-page",
  templateUrl: "pages/home/home.html",
  styleUrls: ["pages/home/home.css"],
})

Question

Why does the AOT Compiler resolve paths relative to the current component, whereas the JIT compiler expects absolute path from the project root? And what is the standard, best practice way to get around this?

More Details

What I've tried so far

Upvotes: 2

Views: 383

Answers (0)

Related Questions