Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanman0109 committed Dec 7, 2016
0 parents commit 17c8478
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# package managers #
####################
node_modules/
npm-debug.log
bower_components/
7 changes: 7 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require('../comm.scss');
require('../comm.css');
require('angular');
require('angular-ui-router');
require('angular-ui-bootstrap');
angular.module('app',['ui.router','ui.bootstrap']);
require('./js/routers/router.js');
12 changes: 12 additions & 0 deletions app/js/routers/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
angular.module('app').config(function($urlRouterProvider,$stateProvider){
$urlRouterProvider.otherwise('/');
$stateProvider.
state('page1',{
url:"/page1",
templateUrl:'/app/views/page1.html'
}).
state('page2',{
url:"/page2",
templateUrl:'/app/views/page2.html'
})
});
1 change: 1 addition & 0 deletions app/views/page1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>我是page1</h1>
1 change: 1 addition & 0 deletions app/views/page2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>我是page2</h1>
1 change: 1 addition & 0 deletions comm.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
body{ background: #f0f0f0}
1 change: 1 addition & 0 deletions comm.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
body{ font-size: 40px; color:red}
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body ng-app="app">
<div>
<a href="" ui-sref="page1">page1</a>
<a href="" ui-sref="page2">page2</a>
</div>
<ui-view></ui-view>
<script src="./bundle.js"></script>
</body>
</html>
Empty file added npm-debug.log.389617559
Empty file.
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "webpack",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start":"webpack-dev-server --inline --hot"
},
"author": "",
"license": "ISC",
"devDependencies": {
"css-loader": "^0.26.1",
"node-sass": "^3.13.0",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"webpack": "^1.13.3",
"webpack-dev-server": "^1.16.2"
},
"dependencies": {
"angular": "^1.5.9",
"angular-ui-bootstrap": "^2.3.0",
"angular-ui-router": "^0.3.2"
}
}
19 changes: 19 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports={
entry:'./app/index.js',
output:{
path:__dirname,
filename:'bundle.js'
},
module:{
loaders:[
{
test:/\.css$/,
loader:'style!css'
},
{
test:/\.scss/,
loader:'style!css!sass'
}
]
}
}

0 comments on commit 17c8478

Please sign in to comment.