【问题标题】:Is there a way to send thymeleaf's data to angular?有没有办法将百里香的数据发送到角度?
【发布时间】:2016-04-16 15:05:51
【问题描述】:

我知道这种方式可以获取数据。

th:attr="ng-click='method(\''+${ans.numbers}+'\',true);

但我不想要这个点击事件。我只想要页面初始化时的这个数据。

【问题讨论】:

    标签: angularjs spring thymeleaf


    【解决方案1】:

    试试这个

    th:attr="ng-init='method(\''+${ans.numbers}+'\',true);
    

    【讨论】:

    • 有没有办法将ArrayList 传递给角度?我在thymeleaf 中有一个List
    • 是的,在您的控制器中创建一个$scope.List array 并分配您的结果并使用ng-repeat 指令在您的视图中访问它
    • 但是如何触发方法。我不希望点击事件。ng-init只发生一次,不是吗?
    猜你喜欢
    • 2019-01-08
    • 2017-02-08
    • 1970-01-01
    • 2019-10-14
    • 2021-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多