umbraco中的角度代码 [英] Angular code in umbraco

查看:79
本文介绍了umbraco中的角度代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试在umbraco配置的页面中添加启用角度的p标签。我为模块创建了一个单独的js文件&工厂和Umbraco我添加了一个新的降价编辑器,并在其中添加了启用角度的HTML。



但它不起作用。只是不绑定角度范围变量。



请允许任何人帮助我..



我尝试了什么:



Umbraco markdown编辑内容:





I am trying to add angular enabled p tag in umbraco configured page. I have created an seperate js file for the module & factory and in Umbraco I have added a new markdown editor and added angular enabled HTML in it.

but its not working. Simply not binding the angular scope variables.

pls can any one help me out..

What I have tried:

Umbraco markdown editor content:

<p>{{message}}</p>



模块创建和添加范围变量。


Module creations and add scope variables.

angular.module('static', [])
            .controller('esastatic', ['$scope',  static]);
    function static($scope) {
       
        $scope.getMessage = function () {
            setTimeout(function () {
                $('#a').html('kjgh');
                $scope.message = 'Fetched after two seconds';
                console.log('message:' + $scope.message);
                $scope.$apply(); //this triggers a $digest
            }, 5000);
        };

        $scope.getMessage();
        
    }





我尝试使用$ apply()绑定umbraco内容



I tried $apply() for binding the umbraco content

.

推荐答案

scope', static ]);
function static
scope', static]); function static(


scope){


scope.getMessage = function (){
setTimeout( function (){
scope.getMessage = function () { setTimeout(function () {


这篇关于umbraco中的角度代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆