Skip to content

Instantly share code, notes, and snippets.

@Johan-ZeLearner
Johan-ZeLearner / app.js
Created May 2, 2015 11:48
Declaration of our erpedia-customer-profile module, with the injection of modules dependancies
(function(){
angular.module('erpedia-customer-profile', ['ui.router', 'ngResource', 'ngJarvisWidget']);
})();
@Johan-ZeLearner
Johan-ZeLearner / index.tpl.php
Last active August 29, 2015 14:20
Entry point of our AngularJS module with js dependancies loaded
<section ng-app="erpedia-customer-profile" ui-view>
</section>
<script>
var jsBaseHref = '<?php echo \P\themePath(); ?>customerProfile/assets';
</script>
<?php $appJsPath = \P\themePath().'customerProfile/assets/javascript'; ?>
<jarvis-widget padding="false" icon="fa-users" title="Liste des profils clients" padding="false">
<h2>Contenu du widget</h1>
<p>
Ceci est un exemple de texte + html que l'option transclude inclue dans le template de la directive jarvis-widget.
</p>
</jarvis-widget>
@Johan-ZeLearner
Johan-ZeLearner / jarvis-widget.html
Last active August 29, 2015 14:20
This directive wraps a basic Jarvis Widget from SmartAdmin theme into an AngularJS Module - more at http://www.zelearner.com/?p=40
<article class="col-xs-12" ng-class="'col-lg-' + jarvis_size">
<div class="jarviswidget jarviswidget-color-darken jarviswidget-sortable" id="{{jarvis_id}}" role="widget">
<header role="heading">
<h2><i class="icon" ng-class="'fa ' + jarvis_icon"></i> <span class="widget-title">{{jarvis_title}}</span></h2>
<span class="jarviswidget-loader" style="display: none;"><i class="fa fa-refresh fa-spin"></i></span></header>
<!-- widget div-->
<div role="content" style="display: block;">
@Johan-ZeLearner
Johan-ZeLearner / navigation-item.html
Last active August 29, 2015 14:16
navigation-item.html
<li><a href="{{nav.url}}">{{nav.label}}</a></li>
@Johan-ZeLearner
Johan-ZeLearner / navigation-item.js
Created February 27, 2015 16:30
navigation-item.js
angular.module("MonApplicationAngularJS")
.directive("navigationItem", function(){
return {
restrict: 'E',
templateUrl: 'navigation-item.html'
};
});
@Johan-ZeLearner
Johan-ZeLearner / navigationLeft.js
Created February 27, 2015 16:27
navigationLeft.js
angular.module("MonApplicationAngularJS")
.directive("navigationLeft", function(){
return {
restrict: 'E',
templateUrl: 'navigation-left.html',
controller: ["$scope", function($scope)
{
$scope.navigationItem = [{
label : 'element de navigation 1',
url: '/#/element1'
@Johan-ZeLearner
Johan-ZeLearner / left-navigation.html
Last active August 29, 2015 14:16
left-navigation.html
<ul class="nav nav-vertical">
<navigation-item ng-repeat="nav in navigationItem"></navigation-item>
</ul>
@Johan-ZeLearner
Johan-ZeLearner / my-header.js
Last active August 29, 2015 14:16
my-header.js
angular.module('MonApplicationAngularJS')
.directive('myHeader', function(){
return {
restrict: 'E',
templateUrl: 'my-header.html'
};
});
@Johan-ZeLearner
Johan-ZeLearner / my-header.html
Last active August 29, 2015 14:16
my-header.html
<header>
<h1>Mon fabuleux site avec AngularJS</h1>
</header>