我想从我的服务器端package.json为客户端安装package.json因为服务器端正在使用节点而客户端正在使用 angular 2 目录结构
server-app
--bin
--node_modules
--package.json
--client-app
--app
--node_modules
--package.json
Run Code Online (Sandbox Code Playgroud)
现在的问题是:
我必须从服务器应用程序文件夹和server-app/client-app文件夹分别运行此命令npm install这将创建部署问题
我想要的是只从 ie server-app运行一次npm install,它也会自动安装 server-app package.json 和 client-side-app package.json 。任何帮助将不胜感激
我正在尝试将广告添加到我当前的活动中,但该活动未显示任何广告.我还为Android Manifest.xml添加了Internet权限
这是我的
.Gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "sms.and.call.alert.flashlight.lpa.com.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:9.6.0'
compile 'com.google.firebase:firebase-ads:9.6.0'
}
Run Code Online (Sandbox Code Playgroud)
这是MainActivity
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(getApplicationContext(), "ca-app-pub-3940256099942544~3347511713");
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest …Run Code Online (Sandbox Code Playgroud) 目前我正在使用共享服务将数据从一个组件传递到其他组件我在第一个组件上设置值并尝试在另一端检索值,但我收到空数组这里是我的代码:
**Ist Compnent:**
@Component({
templateUrl: './landingPage.component.html',
styleUrls: ['./landingPage.component.css'],
providers: [LandingService],
})
export class LandingPageComponent {
constructor(private landingService:LandingService) {
}
@Input() Location:string;
@Input() Type:string;
search(){
//setting value in landing service
this.landingService.SearchData[0]=this.Location;
this.landingService.SearchData[1]=this.Type;
console.log(this.landingService.SearchData) ///this print the data succesfully but when try to access on
// 2nd compnent receive and empty arrat
}
Run Code Online (Sandbox Code Playgroud)
第二部分
@Component({
templateUrl: 'find.component.html',
styleUrls: ['find.component.css'],
providers: [find,LandingService]
})
export class IndexComponent implements OnInit {
searchData:Object=[];
constructor(private landingService: LandingService) {
}
ngOnInit() {
this.searchData=this.landingService.SearchData; .// getting data of my …Run Code Online (Sandbox Code Playgroud) 我想根据今天的时间获得本周的“星期一”,样本是:
21-11-2017 输出应该是 20-11-2017
23-11-2017 输出应该是 20-11-2017
26-11-2017 输出应该是 20-11-2017
var d = new Date();
console.log(d.getDate())
console.log(d.getDay()+1)
d.setDate(d.getDate() - d.getDay()+1);
Run Code Online (Sandbox Code Playgroud)
除了星期日(26-11-2017)手动更改时间以测试它返回的不同情况外,代码工作正常
Mon Nov 27 2017 23:50:39 GMT-0800 (Pacific Standard Time)
Run Code Online (Sandbox Code Playgroud)
对于其他日期,如
25-11-2017 返回 2017 年 11 月 20 日星期一 23:50:39 GMT-0800(太平洋标准时间)
24-11-2017 返回 2017 年 11 月 20 日星期一 23:50:39 GMT-0800(太平洋标准时间)
22-11-2017 它返回 Mon Nov 20 2017 23:50:39 GMT-0800(太平洋标准时间),这是需要的,但对于每个星期天,它返回即将到来的星期一,我想不出什么好东西
简而言之,我想从星期一而不是星期天开始我的一周
angular ×2
admob ×1
android ×1
datetime ×1
javascript ×1
momentjs ×1
node-modules ×1
node.js ×1
npm ×1
npm-install ×1