简体   繁体   English

渲染角度应用程序没有HTML或指令

[英]Rendering angular app without html or directives

I started to work on existing project writed in angular. 我开始研究现有项目的角度。 What is mysterious for me is that in HTML is not used anything from angular. 对我来说神秘的是,在HTML中没有使用任何角度的东西。

<div id="chat">
    <div data-id="6863" data-name="patrik.valkovic"></div>
</div>

Then is just called bootstrap 然后就叫做bootstrap

angular.bootstrap(document.getElementById('chat'), ['drahak.chat'])

Run method of module calls only GET request and connects to socket 模块的运行方法只调用GET请求并连接到套接字

drahak.chat.run([
'Socket', '$http', 'host', 'port', function (Socket, $http, host, port) {
    $http.get('http://' + host.slice(5) + ':' + port + '/config')
        .then(function (config) {
            return drahak.chat.emoticons = config.data.emoticons;
        });
    return Socket.on('events:batch', EventsBatchCallback);
    }
]);

But when I visit this site, it generate while template from separate file. 但是当我访问这个站点时,它会从单独的文件中生成模板。
What is this possible? 这可能是什么? Is angular responsible for this or is code somewhere else, that i don't find it? 角度负责这个或代码在其他地方,我找不到它?

EDIT: Routes are not used. 编辑:不使用路线。

So i finally figured it out. 所以我终于明白了。 In inner div is also "data-token" attribute and "token" directive was registered. 在内部div中还注册了“data-token”属性和“token”指令。 I don't realize that angular could also chain with "data-" attribute (without ng-). 我没有意识到angular也可以链接“data-”属性(没有ng-)。 That directive replace that element with template. 该指令用模板替换该元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM