小编DAi*_*Mor的帖子

Angular2 http同步

请帮我在Angular2中做一个关于http with synchronous的例子?

我尝试如下:在组件中:

getAllAddress(){
    this.addressService.getAllAddress().then(
            result => {
                this.data = result.list;
                this.onChangeTable(this.config, null);
                console.log('FIRST');
            }
        );
    console.log('LAST');
}
Run Code Online (Sandbox Code Playgroud)

在服务中:

public getAllAddress(){
    return this.__http.get('LOCATION')
    .map((res) => {
        return res.json()
    })
    .toPromise();
}
Run Code Online (Sandbox Code Playgroud)

但是控制台显示日志在'FIRST'之前是'最后'.

谢谢.

angular

5
推荐指数
1
解决办法
2510
查看次数

如何在 tarantool 墨盒中执行热重载代码?

如何在tarantool cartridge不重新启动应用程序的情况下执行热重载代码?

tarantool tarantool-cartridge

3
推荐指数
1
解决办法
185
查看次数

解析器中的重定义标记类型

需要为 表格的可能设计语言 实现COS aka MUMPS的语法突出显示

new (new,set,kill)
set kill=new
Run Code Online (Sandbox Code Playgroud)

其中:'new'和'set'是命令,也是变量

grammar cos;

Command_KILL            :( ('k'|'K') | ( ('k'|'K')('i'|'I')('l'|'L')('l'|'L') ) ); 
Command_NEW             :( ('n'|'N') | ( ('n'|'N')('e'|'E')('w'|'W') ) ); 
Command_SET             :( ('s'|'S') | ( ('s'|'S')('e'|'E')('t'|'T') ) );


INT : [0-9]+;
ID : [a-zA-Z][a-zA-Z0-9]*;
Space: ' ';
Equal: '=';

newCommand
    :   Command_NEW Space ID
    ;
setCommand
    :   Command_SET Space ID Space*  Equal Space* INT
    ; 
Run Code Online (Sandbox Code Playgroud)

我有一个问题,当ID像名字一样命令(NEW,SET等)

antlr4

2
推荐指数
1
解决办法
735
查看次数

检查词法分析器中的上一个/左标记

我怎么能找到以前的/左令牌词法
例如

lexer grammar TLexer;

ID     : [a-zA-Z] [a-zA-Z0-9]*;
CARET  : '^';
RTN    : {someCond1}? CARET ID; // CARET not include this token
GLB    : {someCond2}? CARET ID; // CARET not include this token
Run Code Online (Sandbox Code Playgroud)

等等

antlr4

2
推荐指数
1
解决办法
1779
查看次数

标签 统计

antlr4 ×2

angular ×1

tarantool ×1

tarantool-cartridge ×1