Angular JS and partials

后端 未结 3 2046
情歌与酒
情歌与酒 2021-02-01 15:11

Is it possible to embed html page in another one in angular js?

If so, how to do it?

Here in their tutorial, the partial is not embedded in the page but it\'s li

3条回答
  •  死守一世寂寞
    2021-02-01 15:59

    @Wilt is right, but here is a more specific link and a code sample (from https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view )

    In your root template:

    And in your app.config function

    $stateProvider.state("home", {
        views: {
            "": {
                template: "

    Some HTML

    " }, "chart": { templateUrl: "templates/chart.html" }, "data": { template: "" } } })

提交回复
热议问题