Создать вложенный компонент Angular 6 - PullRequest
0 голосов
/ 23 мая 2018

хочу создать вложенный компонент в угловых 6.Структура папок: src-> app-> content-> 1.home, 2.product хочет создать компонент в продукте.Я сделал это уже в папке продукта c: / users / admin / project / test / src / app / content / product> Советы по компонентам ng g для cmd

Получение ошибки как: неожиданный токен / в JSON впозиция 1122

Ответы [ 2 ]

0 голосов
/ 23 мая 2018

Перейдите в корневой каталог, где находится angular-cli

и введите следующую команду:

c :/users/admin/project/test/src/app/content > ng g c product/advisory
0 голосов
/ 23 мая 2018

Источник скопирован с официального документа angular-cli

ng generate component my-new-component
ng g component my-new-component  // using the alias

// components support relative path generation
// if in the directory src/app/feature/ and you run
ng g component new-cmp
// your component will be generated in src/app/feature/new-cmp
// but if you were to run
ng g component ./newer-cmp
// your component will be generated in src/app/newer-cmp
// if in the directory src/app you can also run

    ng g component feature/new-cmp

// and your component will be generated in src/app/feature/new-cmp
...