我试着安装gulp
npm install -g gulp
Run Code Online (Sandbox Code Playgroud)
输出似乎是这样的.(我跳过了一些日志)
npm http 304 https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/lodash._htmlescapes
/usr/bin/gulp -> /usr/lib/node_modules/gulp/bin/gulp.js
gulp@3.6.2 /usr/lib/node_modules/gulp
??? tildify@0.2.0
??? pretty-hrtime@0.2.1
??? deprecated@0.0.1
??? archy@0.0.2
??? semver@2.2.1
??? chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
??? orchestrator@0.3.3 (sequencify@0.0.7)
??? liftoff@0.9.8 (extend@1.2.1, minimist@0.0.8, resolve@0.6.3, findup-sync@0.1.3)
??? vinyl-fs@0.1.4 (graceful-fs@2.0.3, map-stream@0.1.0, mkdirp@0.3.5, vinyl@0.2.3, glob-stream@3.1.9, glob-watcher@0.0.6)
??? gulp-util@2.2.14 (lodash._reinterpolate@2.4.1, dateformat@1.0.7-1.2.3, minimist@0.0.8, vinyl@0.2.3, multipipe@0.0.2, through2@0.4.1, lodash.template@2.4.1)
Run Code Online (Sandbox Code Playgroud)
在上面的脚本中,我可以看到一行/ usr/bin/gulp - > /usr/lib/node_modules/gulp/bin/gulp.js,我想这是在bin文件夹中进行simulink.所以我应该在全球范围内获得gulp但是我得到了这个错误.
No local gulp install found in /var/www/ksapp
Run Code Online (Sandbox Code Playgroud)
知道为什么我得到这个错误.
谢谢
我有一个Angular应用程序.它的工作正常,但随着我的应用程序越来越大,我担心每个控制器都需要注入大量的依赖项.
例如
app.controller('viewapps',[
'$scope','Appfactory','Menu','$timeout','filterFilter','Notice', '$routeParams',
function($scope,Appfactory,Menu,$timeout,filterFilter,Notice,$routeParams) {
//controller code..
}])
Run Code Online (Sandbox Code Playgroud)
我确信将来会依赖列表.我在这里做错了吗?这是正确的方法吗?有效处理这个问题的最佳方法是什么?
我有一个基于wordpress的分类广告网站,我正在尝试创建和xml feed应用程序,从其他网站获取xml并创建广告.我能够从feed创建wordpress中的帖子.但我无法从远程服务器复制图像,没有权限问题,我使用worpress函数wp_handle_upload_error,但我得到错误
这个代码
public function xml_image_upload($upload)
{
if ($this->xml_file_is_image($upload['tmp_name']))
{
$file = wp_handle_upload($upload, $overrides);
}
return $file;
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是" 无效的表单提交 "
我试图解决这个问题很长一段时间.我不知道什么是错的..
我有一个名为 Themex 的库。
//envInjector.ts
import {InjectionToken} from "@angular/core";
export const ENVIRONMENT = new InjectionToken<{[key: string]: any}>('ENVIRONMENT');
Run Code Online (Sandbox Code Playgroud)
//themex.module.ts
import {ENVIRONMENT} from "./envInjector";
@NgModule({
declarations: [
ThemexComponent,
ModalComponent,
UploadComponent,
AlertComponent,
],
imports: [
CommonModule
],
exports: [
ThemexComponent,
ModalComponent,
UploadComponent,
AlertComponent,
],
providers: []
})
export class ThemexModule {
static forRoot(config: {[key: string]: any}): ModuleWithProviders<any> {
return {
ngModule: ThemexModule,
providers: [
{
provide: ENVIRONMENT,
useValue: config
}
]
};
}
}
Run Code Online (Sandbox Code Playgroud)
该库被导入到同一角度工作空间内的角度项目中。
import {ThemexModule} from "themex";
Run Code Online (Sandbox Code Playgroud)
如果我按照上面给出的方式导入它,我会收到错误。
“‘forRoot’的值无法静态确定,因为它是外部声明。”
但是,如果我按照下面给出的方式导入它,一切似乎都有效。
import {ThemexModule} …
Run Code Online (Sandbox Code Playgroud) 我正在尝试登录系统.在角度1中,有设置的方法
withCredentials:true
Run Code Online (Sandbox Code Playgroud)
但我找不到angular2的工作解决方案
export class LoginComponent {
constructor(public _router: Router, public http: Http, ) {
}
onSubmit(event,username,password) {
this.creds = {'Email': 'harikrishna@gmail.com','Password': '01010','RememberMe': true}
this.headers = new Headers();
this.headers.append('Content-Type', 'application/json');
this.http.post('http://xyz/api/Users/Login', {}, this.creds)
.subscribe(res => {
console.log(res.json().results);
});
}
}
Run Code Online (Sandbox Code Playgroud) 我正在创建一个cakephp应用程序,该应用程序应允许管理员以不知道密码的方式登录站点中的任何用户.基本上,如果管理员想要以管理员身份登录,他只需单击一个按钮即可以管理员身份登录.
谢谢
我正在使用angular2fire.我正在查询并试图从一个城市获得所有的旅行.
getAllTours(cityId) {
return this.af.database.list(`/cities/${cityId}/tours`)
.map((tours): any => {
tours.map((tour: any) => {
tour.tour = this.af.database.object(`/tours/${tour.$key}/tours`)
});
return tours;
})
}
Run Code Online (Sandbox Code Playgroud)
如果我在console.log中使用了tour对象,我会获得一个"FirebaseObjectObservable"数组.
我必须循环遍历所有FirebaseObjectObservable,以获取实际数据.
我想知道我是否可以forkJoin所有的observable并将输出作为一个具有单个订阅函数的数组.
这是一种正确的方法吗?
我知道我可以在所有观察者数组上执行异步管道,但我想在控制器内部获取数据,然后在视图中显示之前进行一些处理,因此异步管道对我来说真的不是最好的解决方案.
observable firebase firebase-realtime-database rxjs5 angular
我是yii的新手.我刚刚在yii中创建了一个模块,文件结构如下
-yii
-protected
-modules
-admin
-controller
-model
-view
-layout
-main.php
-css
-style.css
-images
-logo.jpg
Run Code Online (Sandbox Code Playgroud)
我能够将布局设置为这样
'modules'=>array(
// uncomment the following to enable the Gii tool
'admin'=>array(
'layoutPath' => 'protected/modules/admin/views/layouts', ;
Run Code Online (Sandbox Code Playgroud)
)
现在布局是从管理模块呈现的问题是我无法加载样式表
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/protected/modules/admin/css/reset.css" media="all">
Run Code Online (Sandbox Code Playgroud)
有没有人知道在yii中加载样式表的正确方法
var x = 3;
(function (){
console.log('before', x);
var x = 7;
console.log('after', x);
return ;
})();
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,var X全局初始化.所以在函数内部第一个console.log应该打印"3之前",但我没有得到它.原因是我试图重新声明全局变量.
有人可以解释为什么会这样吗?
angular ×3
javascript ×2
php ×2
angular-workspace-configuration ×1
angularjs ×1
cakephp ×1
cakephp-2.1 ×1
file-upload ×1
firebase ×1
gulp ×1
http ×1
linux ×1
observable ×1
rxjs5 ×1
ubuntu ×1
wordpress ×1
yii ×1