Download angular-trianglify, angular, trianglify
- Using bower
bower install --save angular-trianglify angular trianglify
- Or if you are into reinventing the wheel you can download all them manually from their repositories :)
- Load the 3 scripts
<script src="bower_components/trianglify/dist/trianglify.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-trianglify/angular-trianglify.min.js"></script>
</body>
- Add angular-trianglify as a dependency to your angular module
angular.module('MyModule', ['stefanoschrs.angular-trianglify']);
- Add the trianglify attribute to the div you want the background to be placed
<body trianglify>
You can find examples of the usage in the examples
folder
- Basic usecase that adds random triangle patterns as background image to the element you apply this to
- Allow the user to pass options
- Add more examples/ usecases