我有以下情节代码:
var element = document.getElementById(scope.changeid);
function getData(division,redraw) {
var employeeData = [];
if (!division) {
$http.get(api.getUrl('competenceUserAverageByMyDivisions', null)).success(function (response) {
processData(response,redraw);
});
}
else {
$http.get(api.getUrl('competenceUserAverageByDivision', division)).success(function (response) {
processData(response,redraw);
})
}
}
function processData(data,redraw) {
var y = [],
x1 = [],
x2 = [];
data.forEach(function (item) {
y.push(item.user.profile.firstname);
x1.push(item.current_level);
x2.push(item.expected);
});
var charData = [{
x: y,
y: x1,
type: 'bar',
name: $filter('translate')('COMPETENCES.GRAPH.CURRENT'),
marker: {
color: '#23b7e5'
}
}, {
x:y,
y:x2,
type: 'bar',
marker: {
color: '#f05050'
}, …
Run Code Online (Sandbox Code Playgroud) 我有以下composer.json文件:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"intervention/image": "dev-master",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"predis/predis": "^1.1",
"quickpay/quickpay-php-client": "1.0.*",
"sendgrid/sendgrid": "~6.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [ …
Run Code Online (Sandbox Code Playgroud) 所以我有以下组件:
export class ModuleComponentComponent implements OnInit {
dropzoneConf;
fileService = environment.getFileUrl;
constructor(
private moduleComponentService: ModuleComponentService) {
}
@Input()
selectedComponent: ModuleComponent;
ngOnInit() {
this.setDropZoneConfig();
}
}
Run Code Online (Sandbox Code Playgroud)
在那我有以下的HTML:
<h3 class="m-portlet__head-text m--font-success">
<input class="form-control" type="text" [ngModel]="selectedComponent.title" />
</h3>
Run Code Online (Sandbox Code Playgroud)
以及我在html中添加组件的方式:
<div class="col-lg-8 col-x1-12" *ngIf="selectedComponent != null">
<app-module-component [selectedComponent]="selectedComponent"></app-module-component>
</div>
Run Code Online (Sandbox Code Playgroud)
当我在输入字段中输入内容时,它不会更新selectedComponent.title
变量
谁能告诉我发生了什么事?
我有以下代码:
import {Component} from '@angular/core';
import {DocumentScanner, DocumentScannerOptions, DocumentScannerSourceType} from '@ionic-native/document-scanner';
@Component({
selector: 'app-tab2',
templateUrl: 'tab2.page.html',
styleUrls: ['tab2.page.scss']
})
export class Tab2Page {
constructor(private documentScanner: DocumentScanner) {
}
scan() {
const opts: DocumentScannerOptions = {
sourceType: DocumentScannerSourceType.CAMERA,
fileName: 'ticketScan.png',
quality: 100,
returnBase64: true
};
this.documentScanner.scanDoc(opts)
.then((res: string) => console.log(res))
.catch((error: any) => console.error(error));
}
}
Run Code Online (Sandbox Code Playgroud)
当我运行它时,我收到以下错误:
11:42 'DocumentScanner' refers to a value, but is being used as a type here.
Run Code Online (Sandbox Code Playgroud)
谁能告诉我为什么会这样?
如果没有www并且字符串被命名或https://example.com,如何将www添加到网址?
例:
http://ellos.dk //should be http://www.ellos.dk
Run Code Online (Sandbox Code Playgroud)
我知道这可能是相当基本但我似乎找不到一个漂亮的解决方案
angular ×2
javascript ×2
php ×2
angular5 ×1
charts ×1
composer-php ×1
ionic4 ×1
laravel ×1
ngmodel ×1
plotly ×1