Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit 250ca67

Browse files
author
Kent C. Dodds
committed
Updating some dependencies. Adding local manual testing
1 parent 7504a39 commit 250ca67

File tree

5 files changed

+93
-26
lines changed

5 files changed

+93
-26
lines changed

index.html

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title>Quick Example</title>
6+
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css"/>
7+
</head>
8+
<body ng-app="app" ng-controller="MainCtrl as vm">
9+
<div class="jumbotron text-center">
10+
<h1>angular-formly-templates-bootstrap</h1>
11+
</div>
12+
<div class="container">
13+
<div class="row">
14+
<formly-form model="vm.model" fields="vm.fields" options="vm.options" form="vm.form"></formly-form>
15+
</div>
16+
<div class="row">
17+
<h2>Model</h2>
18+
<pre>{{vm.model | json}}</pre>
19+
</div>
20+
<div class="row">
21+
<h2>Form</h2>
22+
<pre>{{vm.form | json}}</pre>
23+
</div>
24+
<div class="row">
25+
<h2>Original Fields</h2>
26+
<pre>{{vm.originalFields | json}}</pre>
27+
</div>
28+
<div class="row">
29+
<h2>Options</h2>
30+
<pre>{{vm.options}}</pre>
31+
</div>
32+
</div>
33+
34+
35+
<script src="node_modules/api-check/dist/api-check.js"></script>
36+
37+
<script src="node_modules/angular/angular.js"></script>
38+
<script src="node_modules/angular-formly/dist/formly.js"></script>
39+
<script src="dist/angular-formly-templates-bootstrap.js"></script>
40+
41+
<script>
42+
var app = angular.module('app', ['formly', 'formlyBootstrap']);
43+
44+
app.controller('MainCtrl', function MainCtrl() {
45+
var vm = this;
46+
47+
vm.model = {};
48+
vm.options = {};
49+
50+
vm.fields = [
51+
{
52+
type: 'input',
53+
key: 'text',
54+
templateOptions: {
55+
label: 'First input',
56+
placeholder: 'It works!'
57+
}
58+
},
59+
{
60+
type: 'select',
61+
key: 'avenger',
62+
templateOptions: {
63+
label: 'Favorite Avenger',
64+
options: [
65+
{name: 'Iron Man', value: 'iron_man', gender: 'Male'},
66+
{name: 'Captain America', value: 'captain_america', gender: 'Male'},
67+
{name: 'Black Widow', value: 'black_widow', gender: 'Female'},
68+
{name: 'Hulk', value: 'hulk', gender: 'Male'},
69+
{name: 'Captain Marvel', value: 'captain_marvel', gender: 'Female'}
70+
],
71+
groupProp: 'gender'
72+
}
73+
}
74+
];
75+
76+
vm.originalFields = angular.copy(vm.fields);
77+
});
78+
</script>
79+
</body>
80+
</html>

loaders/ng-annotate.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,20 @@
3333
"peerDependencies": {
3434
"angular": "^1.2.x || >= 1.4.0-beta.0 || >= 1.5.0-beta.0",
3535
"angular-formly": ">=4.0.5",
36-
"api-check": ">=6.0.10"
36+
"api-check": ">=6.0.10",
37+
"bootstrap": "^3.2.0"
3738
},
3839
"devDependencies": {
39-
"babel-core": "^4.5.5",
40-
"babel-loader": "^4.0.0",
40+
"babel-core": "^5.4.3",
41+
"babel-loader": "^5.1.2",
4142
"deep-extend": "^0.3.2",
42-
"jshint": "2.6.0",
43+
"jshint": "^2.7.0",
4344
"jshint-loader": "^0.8.3",
44-
"lodash-node": "^2.4.1",
45+
"lodash-node": "^3.8.0",
4546
"ng-annotate": "^0.15.4",
47+
"ng-annotate-loader": "0.0.2",
48+
"node-libs-browser": "^0.5.0",
4649
"raw-loader": "^0.5.1",
47-
"webpack": "^1.6.0"
50+
"webpack": "^1.9.6"
4851
}
4952
}

src/types/select.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

webpack.config.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ var path = require('path');
55

66
var exclude = /node_modules/;
77

8-
var ngAnnotateLoader = here('loaders/ng-annotate.js');
9-
console.log(ngAnnotateLoader);
10-
11-
128
var packageJsonString = fs.readFileSync('package.json', 'utf8');
139
var packageJson = JSON.parse(packageJsonString);
1410
console.log('building version', packageJson.version);
@@ -30,6 +26,8 @@ var baseConfig = {
3026
libraryTarget: 'umd'
3127
},
3228

29+
devtool: 'source-map',
30+
3331

3432
stats: {
3533
colors: true,
@@ -64,22 +62,19 @@ var baseConfig = {
6462
module: {
6563
loaders: [
6664
{test: /\.html$/, loader: 'raw', exclude: exclude},
67-
{test: /\.js$/, loader: ngAnnotateLoader + '!babel!jshint', exclude: exclude}
65+
{test: /\.js$/, loader: 'ng-annotate!babel!jshint', exclude: exclude}
6866
]
6967
}
7068
};
7169

72-
var devConfig = {
73-
devtool: 'inline-source-map'
74-
};
70+
var devConfig = {};
7571

7672

7773
var prodConfig = {
7874
output: {
7975
filename: 'angular-formly-templates-bootstrap.min.js',
8076
path: here('dist')
8177
},
82-
devtool: 'source-map',
8378
plugins: [
8479
new webpack.optimize.DedupePlugin(),
8580
new webpack.optimize.OccurenceOrderPlugin(),

0 commit comments

Comments
 (0)