我试图读取JSON文档中的数组长度,但是每当我将字符串硬编码时,它就能工作,但是当我将字符串从外部源获取并解析到var中时,它就无法工作。有人能帮我吗
下面是.js文件的源代码
var app=angular.module('product',[]);
app.controller('ProductCtrl',['$scope','$location','$http',function($scope,$location,$http) {
var url=$location.absUrl();
var baseurl
我试图在Angular4中使用ng2-img-tools包,但遇到了这个错误:
ERROR in Metadata version mismatch for module ~/client/node_modules/ng2-img-tools/dist/ng2-img-tools.d.ts, found version 4, expected 3, resolving symbol AppModule in ~/client/src/app/app.module.ts, resolving symbol AppModule in ~/client/src/app/app.module.ts
我
溶液
感谢,hege-hegedus,,答案如下。把它应用到我的实际代码中,效果很好。
// NOTE : called from another service, but removed function wrap around and angular module setup for brevity sake
// article is serverObject
var articleInstance = new Article(article);
console.log(articleInstance instanceof Article)
// true
console.log(art
我在我的项目中使用了角4和角cli,我只是在上传到我的防火墙存储之前安装了ng2-img-max来操纵图像,但是当我运行ng server时我得到了一个错误:Metadata version mismatch for module C:/Users/Migue/Desktop/weddingAngular/node_modules/ng2-img-max/dist/ng2-img-max.d.ts, found version 4, expected 3, resolving symbol AppModule in C:/Users/Migue/Desktop/weddingAngular/s