Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Carl Swensson 2 posts 72 karma points
    Sep 25, 2018 @ 20:20
    Carl Swensson
    0

    How to use 3rd party Angular component/directive in BackOffice

    I'm wanting to use a 3rd party Angular component/directive in my BackOffice custom section. But how should I do this. I´m new to Angular and how it is integrated with Umbraco. Been googling, reading and testing for a while (hours) without finding a solution.

    I have a working controller (js) that is setting up my current model ($scope) for my view (html).

    Lets say I want to use the "simple" pagination component ngx-pagination: https://github.com/michaelbromley/ngx-pagination

    I get it down via npm but after that? What's the next step in getting it up so I can actually use the <pagination-controls> in my view?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Sep 26, 2018 @ 08:33
    Dave Woestenborghs
    0

    Hi Carl,

    Never tried it. But I think it is a matter of registering the javascripts through a package.manifest file so they get loaded by the backend.

    Don't know if the pagination thing is just an example, but there is already a directive for that in Umbraco core : https://our.umbraco.com/apidocs/ui/#/api/umbraco.directives.directive:umbPagination

    Dave

  • Carl Swensson 2 posts 72 karma points
    Sep 26, 2018 @ 09:50
    Carl Swensson
    0

    The pagination component in my scenario above is just an example.

    I've tried to include the script via the package manifest but it doesn't like the '{' on the first row of the js file being included: 'import {.....'

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Sep 26, 2018 @ 10:55
    Dave Woestenborghs
    0

    I don't think import is supported in javascript.

    This is something when running on NodeJs. I think you need to include the scripts from the build output.

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft