Reputation: 99
I have created rails app and inside it i created Angualr2 app .. right now i have to start both angular server and rails server ... but i want to show angular2 front end when run rails s
. how is this possible.
what i have try is
1) run ng build
and load all files of dist folder in rails public folder
2)replace yield
with <app-root>Loading...</app-root>
. if now i run rails s its show me same rails page .. not loading... or app works.
plz help me how can i integrate Angular2 with rails i am following this https://blog.angular.work/post/angular-cli-on-rails and this
https://blog.angular.work/post/angular-2-on-rails.
also i am using Angular-cli
Upvotes: 1
Views: 221
Reputation: 11299
Yes, it's now possible if you use Webpack and the Rails Webpacker gem.
You can then easily develop Angular components using TypeScript.
This gem is still in heavy development so you may want to use the master branch: https://github.com/rails/webpacker#ready-for-angular-with-typescript
Upvotes: 2