嗯...在角度1.xy是
angular.module('myApp', []).directive('myDirective', function(){
return {
templateUrl : function(tElement, iAttrs){
return 'http://' + iAttrs.myDirective // More...
}
}
});
Run Code Online (Sandbox Code Playgroud)
但是......在Angular2中
@Component({
selector: 'my-Directive',
templateUrl: 'http://???'
})
class HelloWorld {
}
Run Code Online (Sandbox Code Playgroud)
好吧,在医生说只有一个String.因为它被处理为angular2中的函数?
尝试测量基于距离的加速度(加速度计移动).如果那是真的
Accelerometer {
id: accel
dataRate: 1000 / 25
onReadingChanged: {
console.log(reading.x, reading.y, reading.z);
}
}
Run Code Online (Sandbox Code Playgroud)
在控制台中
D/libsensor.so(16533): qrc:/main.qml:20 (onReadingChanged): qml: 1.359906554222107,8.791508674621582,-0.4405331015586853
Run Code Online (Sandbox Code Playgroud)
现在,当您显示信息并使移动设备完全静止(静止)时.显示所有轴的加速度,这是荒谬的!你知道为什么吗?