Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
fixes #191: yeoman 0.20.1 - new templating engine
Browse files Browse the repository at this point in the history
  • Loading branch information
gruppjo committed May 20, 2015
1 parent f9b933e commit a7f4c23
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 17 deletions.
8 changes: 5 additions & 3 deletions constant/templates/_constant.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict';
angular.module('<%= moduleName %>')
.constant('<%= constantName %>', {
<% if (options.sample === 'start') {%>

<% if (options.sample === 'start') { -%>
// gulp environment: injects environment vars
// https://github.com/mwaylabs/generator-m#gulp-environment
ENV: {
Expand All @@ -15,7 +16,8 @@ angular.module('<%= moduleName %>')
/*inject-build*/
/*endinject*/
}
<% } else { %>
<% } else { -%>
CONSTANT_1: 'meaningful value',
<% } %>
<% } -%>

});
11 changes: 7 additions & 4 deletions controller/templates/_controller.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
'use strict';
angular.module('<%= moduleName %>')
.controller('<%= controllerName %>', function (<% if(options.sample === 'start') { %>Start, Config<% } %>) {
<% if (options.sample === 'start') {%>

console.log('Hello from your Controller: <%= controllerName %> in module <%= moduleName%>:. This is your controller:', this);
// TODO: do your controller thing

<% if (options.sample === 'start') {-%>
// bind data from service
this.someData = Start.someData;
this.ENV = Config.ENV;
this.BUILD = Config.BUILD;
<% } %>
console.log('Hello from your Controller: <%= controllerName %> in module <%= moduleName%>:. This is your controller:', this);
// TODO: do your controller thing

<% } -%>
});
4 changes: 2 additions & 2 deletions module/templates/_main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if (options.sample === 'start') {%>
<% if (options.sample === 'start') { -%>
/*
To customize the look and feel of Ionic, you can override the variables
in ionic's _variables.scss file.
Expand All @@ -24,5 +24,5 @@ $ionicons-font-path: "../assets/fonts" !default;

// TODO: import scss files from other modules
// @import "../../<module>/styles"
<% }%>
<% } -%>

6 changes: 4 additions & 2 deletions module/templates/_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ angular.module('<%= moduleName %>', [
.config(function ($stateProvider<% if (options.sample === 'start') {%>, $urlRouterProvider<%} %>) {

console.log('Allo! Allo from your module: ' + '<%= moduleName %>');
<% if (options.sample === 'start') {%>
<% if (options.sample === 'start') { -%>

$urlRouterProvider.otherwise('/main');
<%}%>
<%} -%>

// some basic routing
$stateProvider
.state('<%= moduleFolder %>', {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"inquirer": "^0.8.0",
"mkdirp": "^0.5.0",
"underscore.string": "^3.0.3",
"yeoman-generator": "^0.19.2",
"yeoman-generator": "^0.20.1",
"yosay": "^1.0.1"
},
"devDependencies": {
Expand Down
9 changes: 6 additions & 3 deletions service/templates/_service.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
'use strict';
angular.module('<%= moduleName %>')
.service('<%= serviceName %>', function () {

console.log('Hello from your Service: <%= serviceName %> in module <%= moduleName %>');
<% if(options.sample === 'start') {%>
// TODO: do your service thing

<% if(options.sample === 'start') { -%>
// some initial data
this.someData = {
binding: 'Yes! Got that databinding working'
};
<% } %>
// TODO: do your service thing

<% } -%>
});
6 changes: 4 additions & 2 deletions template/templates/_template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ion-view view-title="<%= moduleName %> module">
<ion-content>
<ion-list>

<ion-item class="item item-divider">
This is your <%= templateName %> template!
</ion-item>
Expand All @@ -12,7 +13,7 @@
images working?<br>
<img width="75" src="main/assets/images/[email protected]">
</ion-item>
<% if(options.sample === 'start') {%>
<% if(options.sample === 'start') { -%>
<ion-item class="item">{{start.someData.binding}}</ion-item>
<ion-item class="item item-divider">Environment variables:</ion-item>
<ion-item class="item item-text-wrap">
Expand All @@ -22,7 +23,8 @@
<ion-item class="item item-text-wrap">
<pre>{{start.BUILD | json}}</pre>
</ion-item>
<% } %>
<% } -%>

</ion-list>
</ion-content>
</ion-view>

0 comments on commit a7f4c23

Please sign in to comment.