小编Vic*_*nak的帖子

参数'site'在Joomla getApplication中意味着什么?

$a = JFactory::getApplication('site');
Run Code Online (Sandbox Code Playgroud)

我在Joomla API中遇到过这个问题:

static JApplication getApplication ([mixed $id = null], [array $config = array()], [string $prefix = 'J'])
Run Code Online (Sandbox Code Playgroud)

$ id,$ config和$ prefix的示例是什么?

php joomla

6
推荐指数
1
解决办法
6912
查看次数

如何在@ViewChild Angular2中查找子元素?

import { Component, ViewChild } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `
    <div #container>
        <p>para 1</p>
        <p>para 2</p>
        <button>button 1</button>
    </div>
  `
})
export class AppComponent {
  @ViewChild('container') myDiv;

  ngAfterViewInit(){
    //this console.log would print this [p, p, button]
    console.log(this.myDiv.nativeElement.children);
    //how can I access to only p nativeElement only? 
  } 

}
Run Code Online (Sandbox Code Playgroud)

plunker

angular

6
推荐指数
1
解决办法
9549
查看次数

如何验证和显示错误消息 - Angular2材料设计?

我有这个输入:

<form #f="ngForm" name="productForm">
     <md-input [(ngModel)]="product.price" name="price" required="true" placeholder="Price (USD)"></md-input>
     <div ng-messages="productForm.price.$error" role="alert">
         <div ng-message-exp="['required']">
              Price is required
          </div>
     </div>
</form>
Run Code Online (Sandbox Code Playgroud)

但是需要消息价格不会出现.

我该如何正确格式化错误消息?

当价格输入为空时,将显示ng-invalid类:

在此输入图像描述

在此输入图像描述

当我填写一些东西: 在此输入图像描述

Angular在其中注入ng-valid类. 在此输入图像描述

我想要的是类似于angular1 md设计的样式,如下所示:

在此输入图像描述

typescript material-design angular-material angular

5
推荐指数
2
解决办法
2万
查看次数

如何在 Sequelize 中执行算术运算?

我怎样才能在续集中做到这一点?

SELECT ProductID, Name, ListPrice, ListPrice * 1.15 AS NewPrice  
FROM Production
Run Code Online (Sandbox Code Playgroud)

我试过了:

db.Production.findAndCountAll(
    attributes: {
        include: [
            ['ListPrice * 1.15', 'NewPrice']
        ]
    }
).then(function(orders){
    return res.jsonp(output);
})
Run Code Online (Sandbox Code Playgroud)

但它不起作用。

这是我期望的查询:

SELECT Production.ProductID, Production.Name, Production.ListPrice, Production.ListPrice * 1.15 AS NewPrice  
FROM Production
Run Code Online (Sandbox Code Playgroud)

相反,我看到了这个查询:

SELECT Production.ProductID, Production.Name, Production.ListPrice, ListPrice * 1.15 AS NewPrice  
FROM Production
Run Code Online (Sandbox Code Playgroud)

javascript mysql node.js sequelize.js

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

使用 underscore.js 从数组中删除多个项目?

我有这个:

var arrA = [{id:1,name:'a'},{id:2,name:'b'},{id:3,name:'c'}];
Run Code Online (Sandbox Code Playgroud)

我有另一个数组:

var arrB = [{id:1,other:'c'},{id:3,other:'d'}];
Run Code Online (Sandbox Code Playgroud)

如何使用 underscore.js 从 arrA 中删除与 arrB 具有相同属性 ID 的项目?

预期的结果应该是:

arrA = [{id:2, name:'b'}];
Run Code Online (Sandbox Code Playgroud)

谢谢,

javascript underscore.js

4
推荐指数
1
解决办法
2672
查看次数

Sequelize的种子日志在哪里?

当我运行db:seed:all命令时,它给了我这个错误:

Seed file failed with error: Validation error
Run Code Online (Sandbox Code Playgroud)

如何查看Sequelize中哪个验证出错的日志?

javascript node.js sequelize.js

4
推荐指数
1
解决办法
2723
查看次数

如何在Ionic2中使模态成为全屏?

这是我的模态代码:

    let modal = Modal.create(DailyReportPage);
    this.nav.present(modal);
Run Code Online (Sandbox Code Playgroud)

它在手机上运行正常,但在平板电脑上它看起来像这样: 在此输入图像描述 我想要的是让它看起来像这样: 在此输入图像描述

typescript ionic2 angular

4
推荐指数
2
解决办法
5907
查看次数

如何正确地将document.addEventListener添加到Angular2?

我遇到过cordova RemoteControl插件,为了监听它的事件,需要注册addEventListener.

//listen for the event
document.addEventListener("remote-event", function(event) {
//do something
});
Run Code Online (Sandbox Code Playgroud)

对我来说这是一个合适的方式吗?

angular

4
推荐指数
1
解决办法
1万
查看次数

如何在Ubuntu中安装Visual Studio 2008和MS SQL Server 2008?

我想在我的PC上安装Ubuntu OS上的Visual Studio 2008和MS SQL Server 2008,但是,我不知道如何.我可以请一些小贴士吗?谢谢.

sql-server installation ubuntu visual-studio

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

window.onload不适用于Google Chart API

我想将谷歌图表放入window.onload,但它没有显示任何内容,而在状态栏中显示"从www.google.com传输数据......"我知道我们是否将代码放在窗口外面. onload它肯定会工作,但我想放入window.onload.有什么建议?谢谢

这是我的代码

在此输入图像描述

javascript charts

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