我的问题是,当单击注销按钮ng2-idle时,它继续工作。为了解决此问题,我再次将setIdle和setTimeout函数设置为1秒钟。
但是,当用户转移到登录屏幕时,该应用将花费1秒给出超时。
我想知道在单击调用logout()函数的注销按钮后是否有任何强制超时或结束ng2-idle的方法。
import {Component} from '@angular/core';
import {Router} from "@angular/router";
import {Http, Headers} from "@angular/http";
import {NgClass} from '@angular/common';
import {Observable} from "rxjs/Observable";
import 'rxjs/Rx';
import {HeaderService} from './header.service';
import {Idle, DEFAULT_INTERRUPTSOURCES} from 'ng2-idle/core';
@Component({
selector: 'my-header',
templateUrl: './js/app/header/header.component.html',
styleUrls: ['./js/app/header/header.component.css']
})
export class HeaderComponent {
nome = localStorage['nome'];
constructor(private _router: Router, private _http: Http, private _headerService: HeaderService, private idle: Idle) {
idle.setIdle(5);
idle.setTimeout(1800);
idle.setInterrupts(DEFAULT_INTERRUPTSOURCES);
idle.onTimeoutWarning.subscribe((countdown:number) => {
console.log('TimeoutWarning: ' + countdown);
});
idle.onTimeout.subscribe(() => {
console.log('Timeout');
localStorage.clear();
this._router.navigate(['/auth', …Run Code Online (Sandbox Code Playgroud) 我做了离子2 sidemenu的应用程序构建,但是svg出现在Chrome中,但生成文件android-debug.apk后svg没有出现在Android中:
按照我使用的命令:
npm install -g ionic cordova
ionic start myApp --v2 sidemenu
ionic platform add android
ionic build android
/myApp/src/pages/page1/page1.html
<ion-header>
<ion-navbar>
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Page One</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<h3>Ionic Menu Starter</h3>
<img src="../../assets/img/myapp.svg" alt="">
<p>
If you get lost, the
<a href="http://ionicframework.com/docs/v2">docs</a> will show you the way.
</p>
<button ion-button secondary menuToggle>Toggle Menu</button>
</ion-content>
Run Code Online (Sandbox Code Playgroud)
你能帮我解决这个问题吗?
键盘不能与一起正常使用TextField。
我在代码14下面放了代码TextField,但是例如在字段14中单击时,键盘没有出现,也不在TextField点击的下方。
您能帮我解决这个键盘问题吗?这个问题没有出现,也没有让我进入所选的领域吗?
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(home: new HomePage()));
}
class HomePage extends StatefulWidget {
@override
HomePageState createState() => new HomePageState();
}
class HomePageState extends State<HomePage> {
final TextEditingController _controller = new TextEditingController();
@override
Widget build(BuildContext context) {
return new Scaffold(
body: new Stack(
children: <Widget>[
new ListView(
shrinkWrap: true,
children: <Widget>[
new TextField(
controller: _controller,
decoration: new InputDecoration(
hintText: 'Type something 1',
),
),
new TextField(
controller: _controller,
decoration: new …Run Code Online (Sandbox Code Playgroud) 经过大量研究和修复问题,我到达了我的github中的以下位置。但我不知道我是否正确安装了 json。对于出现以下错误:
{
error:
{
errors: [
{
domain: global,
reason: parseError,
message: This API does not support parsing form-encoded input.
}
],
code: 400,
message: This API does not support parsing form-encoded input.
}
}
Run Code Online (Sandbox Code Playgroud)
我正在设置帖子如下,更多细节项目在我的github中
// scope for send email
GoogleSignIn googleSignIn = new GoogleSignIn(
scopes: <String>[
'https://www.googleapis.com/auth/gmail.send'
],
);
await googleSignIn.signIn().then((data) {
testingEmail(data.email, data.authHeaders);
});
// userId is the email
Future<Null> testingEmail(userId, header) async {
String url = 'https://www.googleapis.com/gmail/v1/users/' + userId + '/messages/send';
final …Run Code Online (Sandbox Code Playgroud) 当我angular.html用Chrome 打开文件angularjs时,html正常工作,显示表格中的信息数组.但是,当我使用Django时,相同的angular.html文件,angularjs不会显示表中的信息数组.我不知道我该怎么办?
文件angular.html
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular.min.js"></script>
<script>
function tabela($scope){
$scope.linhas2=[["Nexus S1","Oi1"],["Nexus S2","Oi2"],["Nexus S3","Oi3"]]
}
</script>
</head>
<body>
<div ng-controller="tabela">
<table>
<tr ng-model="item2" ng-repeat="item2 in linhas2">
<td ng-repeat="item3 in item2">{{ item3 }}</td>
</tr>
</table>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
文件views.py
from django.shortcuts import render_to_response
def ang(request):
return render_to_response("angular.html")
Run Code Online (Sandbox Code Playgroud)
文件urls.py
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^angular/','bvmfconsulta.views.ang'),
)
Run Code Online (Sandbox Code Playgroud)
Django发现angular.html但显示空白页面.
在我的应用程序中,我有一个注册产品列表。
我正在尝试在 url 中发送产品名称。
但是,它具有#标签的产品名称和产品名称到达服务器时不完整:
前端
var product = "PLASTIC #1JQ-M 1CV T-PLAS"
return this._http.get(Config.URL_SITE + 'list/productLen?product='+product)...
Run Code Online (Sandbox Code Playgroud)
后端
router.get('/productLen', function(req, res, next) {
var productName= req.query.product;
console.log(productName) //PLASTIC
...
Run Code Online (Sandbox Code Playgroud)
如何让productName变量接收全名?
"PLASTIC #1JQ-M 1CV T-PLAS"
当我在flutter run调试模式下运行时,下面的代码显示以下错误:
type 'List' is not a subtype of type 'String' of 'value' where
当我在发布模式下运行时,flutter run --release错误不会出现,我可以识别我选择删除的项目。
问题出在第 39 行:
key: new Key(i),
将key只接受字符串值:
Key(String value) ? Key
但我正在传递一个List似乎是动态项目的:
dynamic i
但我需要通过一个List上Key,以能够识别被排除的项目将是什么。
我怎样才能在调试模式下解决这个问题?
为什么会发生这种行为并且在发布模式下不会出现问题?
import 'package:flutter/material.dart';
import 'dart:ui' as ui;
void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new MyHomePage(),
);
}
}
class MyHomePage extends …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用传递路线之间的值Navigator.pushReplacementNamed(),但我没有得到。
我无法弄清楚数据将退出pushReplacementNamed并获取routes密钥的正确语法和逻辑。
你能帮助我吗?
输入以下代码以帮助理解:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
routes: <String, WidgetBuilder> {
'/form': (BuildContext context) => new FormPage(email: ???, header: {'auth': ???}),
},
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return …Run Code Online (Sandbox Code Playgroud) 我不知道错误在哪里,因为在完成结构后,它在我看来 undefined: Payload
这是一个非常讨厌的结构,因为它有足够的结构嵌套和结构切片
你能帮我解决这个问题吗,因为我无法解决它?
https://play.golang.org/p/QewpCfTWY0l
package main
import (
"fmt"
)
type DialogFlowResponseSuggestion struct {
Payload struct {
Google struct {
ExpectUserResponse bool `json:"expectUserResponse"`
RichResponse struct {
Items []struct {
SimpleResponse struct {
TextToSpeech string `json:"textToSpeech"`
} `json:"simpleResponse"`
} `json:"items"`
Suggestions []struct {
Title string `json:"title"`
} `json:"suggestions"`
} `json:"richResponse"`
} `json:"google"`
} `json:"payload"`
}
func main() {
in := DialogFlowResponseSuggestion{
Payload: Payload{
Google: Google{
ExpectUserResponse: true,
RichResponse: RichResponse{
Items: []Items{
Items{SimpleResponse: SimpleResponse{dialog.MReturn.Message}},
},
Suggestions: []Suggestions{
Suggestions{Title: "Suggestion Chips"}, …Run Code Online (Sandbox Code Playgroud)