Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

How to create a new Angular Component #51

@alavin

Description

@alavin

Hi,

Thank you for this build. I am having an issue trying to create a new template.

For example i am trying to create Data Tables template.
To do that I've first run the command: php artisan ng:component data-tables

Which create new files in
angular/app/components/data-tables/data-tables.component.html
angular/app/components/data-tables/data-tables.component.js
angular/app/components/data-tables/data-tables.scss

In data-tables.component.html i put some HTML. Basically i copied the default source code from ADMINLTE.

After that I created a new state route in routes.config.js
.state('app.datatables', {
url: '/data-tables',
data: {
auth: true
},
views: {
'main@app': {
template: ''
}
}
})

And finally in nav-sidebar.component.html
I updated the row:
<li><a ui-sref="app.datatables"><i class="fa fa-circle-o"></i> Data tables</a></li>

Therefore now i am able to click on the link and load /data-tables but i get a blank page.

Is there something that i am missing?

Thanks for you help.

Vince.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions