我有一项服务,每2分钟拨打一次我的休息服务.在我的服务上,我有以下功能
getNotifications(token: string) {
const body = 'xxxxxxxxx=' + token;
return this.http.post('/rest/ssss/ddddddd/notificationcount', body, this.options)
.map((res) => res.json());
}
Run Code Online (Sandbox Code Playgroud)
在我的组件上,我调用我的服务函数来调用API.
this.notificationService.getNotifications(this.token).subscribe((data) => {
console.log(data);
});
Run Code Online (Sandbox Code Playgroud)
我想每2分钟打一次电话,最好的办法是什么?
我正在构建一个离子2应用程序,我可以用离子构建ios构建应用程序,我没有得到任何错误,但在xcode上,当我构建我的应用程序时,我得到以下错误.
Apple Mach-O链接器(id)错误链接器命令失败,退出代码为1(使用-v查看调用).
我怎样才能解决这个问题?
这是我的系统信息
Cordova CLI:6.5.0
离子框架版本:2.3.0
离子CLI版本:2.2.2
Ionic App Lib版本:2.2.1
Ionic App Scripts版本:1.1.4
ios-deploy版本:1.9.0
操作系统:macOS Sierra
节点版本:v6.9.4
Xcode版本:Xcode 8.3 Build版本8E162
我在我的应用程序上使用了 ag-Grid,但我用默认主题 (ag-theme-balham) 破坏了它。
在一个特定的组件上,我想更改标题背景颜色,但是当我在我的 component.scss 文件中添加 CSS 时,没有任何反应。
我在我的 angular-cli.json 文件中添加了 ag-Grid css
"styles": [
"../node_modules/font-awesome/scss/font-awesome.scss",
"../node_modules/ag-grid/dist/styles/ag-grid.css",
"../node_modules/ag-grid/dist/styles/ag-theme-balham.css",
"styles.scss"
],
Run Code Online (Sandbox Code Playgroud)
在 component.scss 文件上,我有以下 CSS
.ag-theme-balham .ag-header {
background-color: #e0e0e0;
}
Run Code Online (Sandbox Code Playgroud)
但是没有任何反应,并且颜色不会应用于标题。
我正在尝试使用 nodeJS 创建 Azure 函数,但是当我调用 https API 时,我收到一条错误消息。
是否可以从 azure 函数进行 HTTPS 调用?
这是我的代码
const https = require('https');
const querystring = require('querystring');
module.exports = async function (context, req) {
if (req.query.accessCode || (req.body && req.body.accessCode)) {
var options = {
host: 'api.mysite.com',
port: 443,
path: '/oauth/access_token',
method: 'POST'
};
var postData = querystring.stringify({
client_id : '1234',
client_secret: 'xyz',
code: req.query.accessCode
});
var req = https.request(options, function(res) {
context.log('STATUS: ' + res.statusCode);
context.log('HEADERS: ' + JSON.stringify(res.headers));
res.on('data', function (chunk) {
context.log('BODY: …Run Code Online (Sandbox Code Playgroud)