我用来构建我的应用程序的技术是React,Web-pack,Babel和AlT(flux实现)
当web pack尝试编译我的应用程序时,我收到错误.不确定我缺少哪些库.
有人可以请教吗?
##.babelrc file##
{"presets": ["react", "es2015", "stage-0"]}
Run Code Online (Sandbox Code Playgroud)
我正在尝试从Web API接收的子实体访问属性字段(JSON).但是,通过查看浏览器控制台,它显示的是引用而不是字段.如何访问这些字段?
ANGULAR JS VIEW
<table infinite-scroll='tF.loadMore()' infinite-scroll-disabled='tF.isBusy' infinite-scroll-distance='3' class="responsive">
<thead>
<tr>
<th>FIELD 1</th>
<th>FIELD 2</th>
<th>FIELD 3</th>
<th>FIELD 4</th>
<th>FIELD 5</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in tF.items | filter:searchFilter">
<td>{{item.CompanyDomainModel.CompanyName}}</td>
<td>{{item.RatingDomainModel.RatingValue}}</td>
<td>{{item.Views}}</td>
<td>{{item.Clicks}}</td>
<td>{{item.EmailSent}}</td>
</tr>
</tbody>
<tfoot ng-show='tF.isBusy'>
<tr>
<td colspan="9"><spinner show="tF.isBusy" /><span class="bold">{{tF.status}}</span> </td>
</tr>
</tfoot>
</table>
Run Code Online (Sandbox Code Playgroud)
服务
public ICollection<CompanyStatDomainModel> GetRecordsByPageSize(int page) {
const int pgeSize = 20;
var result = _companyStatRepo
.AllIncluding(c => c.CompanyDomainModel, c => c.RatingDomainModel)
.OrderBy(c => c.CompanyStatId)
.Skip(page * pgeSize)
.Take(pgeSize)
.ToList();
return …Run Code Online (Sandbox Code Playgroud) 我正在关注多视点的视频教程.课程名称是"使用React,Flux,Webpack和Firebase构建实时应用程序".
请参阅下面的代码和我所拥有的问题的附加屏幕截图.当我尝试重新构建文件时,Webpack失败了.有人可以告诉你这个问题是什么.我目前正在使用所有最新的库.
/*webpack.config.js*/
module.exports = {
entry: {
main: [
'./src/main.js'
]
},
output: {
filename: './public/[name].js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel'
}
]
}
}
/*App.jsx*/
import React from 'react';
class App extends React.Component {
constructor() {
super();
this.state = {
messages: [
'hi there how are you ?',
'i am fine, how are you ?'
]
}
}
render() {
var messageNodes = this.state.messages.map((message)=> {
return (
<div>{message}</div>
);
});
return …Run Code Online (Sandbox Code Playgroud) 我已经安装了react-hot-loader并在webpack.config.js中引用了该模块.但是,当我尝试运行webpack来编译脚本时,我收到一个错误.
请看下面的截图.有人可以告诉问题是什么.仅供参考,我正在使用所有最新的图书馆.
[1]: http://i.stack.imgur.com/2GCa1.jpg
/*webpack.config.js
module.exports = {
devtool: 'eval-source-map',
entry: {
main: [
'./src/main.js'
]
},
output: {
filename: './public/[name].js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: ['react-hot','babel-loader'],
query: {
presets: ['es2015', 'react']
}
}
]
}
}
/*UPDATE*/
Code update
I have added an "s" after loader. It is now giving me the below error.
[2]: http://i.stack.imgur.com/LL1nn.jpg
Run Code Online (Sandbox Code Playgroud)