This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module("demoApp", ['ng.bs.dropdown']) | |
.controller("YearController", function($scope){ | |
$scope.years = [ | |
"2015", | |
"2014", | |
"2013", | |
"2012", | |
"2011", | |
"2010" | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require("react"); //use require(module_name) to load module. | |
React.render( | |
<p>Hello, World!</p>, | |
document.getElementById('hello') | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module("demoApp", []) | |
.controller("ProductController", function($scope){ | |
$scope.currPage = 3; | |
$scope.numPerPage = 5; | |
$scope.products = []; | |
for(var i=0;i<50;i++){ | |
$scope.products[i] = "Product " + i; | |
} | |
$scope.changeProduct = function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- "0.10.25" | |
env: | |
- NODE_ENV=travis | |
before_install: | |
- sudo npm install bower -g | |
- bower install | |
- sudo chown -R $(whoami) /home/shippable/.npm | |
after_success: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module("demoApp", []) | |
.directive("productContainer", function(){ | |
return{ | |
scope:{ | |
data: "=" | |
}, | |
templateUrl: "productsTemplate.html", | |
link: function(scope, el, attr){ | |
// splitSize 表示每列有幾個 product | |
scope.splitSize = parseInt(attr["splitSize"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require("react"); | |
var Content = React.createClass({ | |
render: function(){ | |
return( | |
<div>{this.props.value}</div> | |
) | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
export default React.createClass({ | |
render() { | |
return ( | |
<div>Current value: {this.props.count}</div> | |
) | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task("build", function(){ | |
//building your app. | |
}); | |
gulp.task("dev", function(){ | |
gulp.watch("./src/app.js", ['build']); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// preprocessor.js | |
var ReactTools = require('react-tools'); | |
module.exports = { | |
process: function(src) { | |
return ReactTools.transform(src, { | |
harmony:true | |
}); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var ReactBsTable = require('react-bootstrap-table'); | |
var BootstrapTable = ReactBsTable.BootstrapTable; | |
var TableHeaderColumn = ReactBsTable.TableHeaderColumn; | |
var DemoApp = React.createClass({ | |
getInitialState: function () { | |
/* | |
segments is a simple data for table | |
selected is mean that selected row on table. default is empty | |
*/ |
OlderNewer