A
A
AlexeyMaker2016-09-28 12:44:12
Yii
AlexeyMaker, 2016-09-28 12:44:12

How to properly configure routing and connect Angular 2 in a Yii2 project?

Developed projects in Yii2.
Now there is a need to write a service (something like a CRM system), the server part is Yii2, for the client part my choice fell on Angular 2, I would also like to study this framework (now there is a complete 0 in it).
How to properly configure routing and connect Angular 2 in a project?
I found a good AngularJS guide ( blog.neattutorials.com/angularjs-yii2-part-1-routing/) but I can't do the same in Angular 2.
composer require "npm-asset/angular2" gives "Could not parse version constraint &&: Invalid version string "&&""
(tried several versions of composer-asset-plugin)
if installing Angular 2 via https://angular.it is not entirely clear what and how to connect to Assets yii2. Or is it better to completely separate the client side from the server side and use the full RESTful API?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eudj1n, 2016-12-10
@eudj1n

You answered your own question :)
The documentation for Angular 1 and Angular 2, as well as the two frameworks themselves, are completely different, so either consider working with the version for which there is a guide, or go the route of separating the front-end from the back-end and interacting through the API.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question