Skip to content

Commit 95659b1

Browse files
committed
gulp inline ng2 template plugin added
1 parent bbc53f0 commit 95659b1

File tree

9 files changed

+18
-14
lines changed

9 files changed

+18
-14
lines changed

gulpfile.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var gulp = require('gulp');
22
var ext_replace = require('gulp-ext-replace');
33
var tslint = require('gulp-tslint');
4+
var inlineNg2Template = require('gulp-inline-ng2-template');
45
/* CSS */
56
var postcss = require('gulp-postcss');
67
var sourcemaps = require('gulp-sourcemaps');
@@ -13,7 +14,7 @@ var tsProject = typescript.createProject('tsconfig.json');
1314
var paths = {
1415
src: {
1516
ts: './src/ts/**/*.ts',
16-
scss: './src/scss/**/*.scss'
17+
scss: './src/scss/app.scss'
1718
},
1819
dest: {
1920
js: './app/js',
@@ -29,12 +30,13 @@ gulp.task("tslint", function () {
2930
.pipe(tslint.report());
3031
});
3132

32-
gulp.task('build-ts' , ["tslint"], function () {
33-
return gulp.src(paths.src.ts)
34-
.pipe(sourcemaps.init())
35-
.pipe(typescript(tsProject))
36-
.pipe(sourcemaps.write())
37-
.pipe(gulp.dest(paths.dest.js));
33+
gulp.task('build-ts', ["tslint", "build-css"], function () {
34+
return gulp.src(paths.src.ts)
35+
.pipe(inlineNg2Template())
36+
.pipe(sourcemaps.init())
37+
.pipe(typescript(tsProject))
38+
.pipe(sourcemaps.write())
39+
.pipe(gulp.dest(paths.dest.js));
3840
});
3941

4042
gulp.task('build-css', function () {

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Angular BeyondScheme</title>
66
<meta charset="UTF-8">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<link rel="stylesheet" href="app/css/app.component.css">
8+
<link rel="stylesheet" href="app/css/app.css">
99

1010
<!-- Polyfill(s) for older browsers -->
1111
<script src="node_modules/core-js/client/shim.min.js"></script>

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"concurrently": "^2.0.0",
3232
"gulp": "^3.9.0",
3333
"gulp-ext-replace": "^0.2.0",
34+
"gulp-inline-ng2-template": "^4.0.0",
3435
"gulp-postcss": "^6.0.1",
3536
"gulp-sourcemaps": "^1.6.0",
3637
"gulp-tslint": "6.1.2",
File renamed without changes.
File renamed without changes.

src/scss/app.component.scss renamed to src/scss/app.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@import "_dashboard.scss";
2+
@import "_post.scss";
3+
14
body {
25
margin: 32px;
36
font-family: "Roboto", Arial, sans-serif;
@@ -36,4 +39,4 @@ button {
3639

3740
button:hover {
3841
background-color: #cfd8dc;
39-
}
42+
}

src/ts/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Component} from "@angular/core";
22

33
@Component({
44
selector: "my-app",
5-
templateUrl: "../src/html/app.component.html",
5+
templateUrl: "/src/html/app.component.html",
66
})
77
export class AppComponent {
88

src/ts/dashboard/components/dashboard.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import {AnonymousSubscription} from "rxjs/Subscription";
77

88
@Component({
99
selector: "dashboard",
10-
styleUrls: ["app/css/dashboard.component.css"],
11-
templateUrl: "../../../src/html/dashboard/dashboard.component.html",
10+
templateUrl: "/src/html/dashboard/dashboard.component.html",
1211
})
1312
export class DashboardComponent implements OnInit, OnDestroy {
1413

src/ts/post/components/post.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import {AnonymousSubscription} from "rxjs/Subscription";
1010
@Component({
1111
providers: [CommentService],
1212
selector: "bid",
13-
styleUrls: ["app/css/post.component.css"],
14-
templateUrl: "../../../src/html/post/post.component.html",
13+
templateUrl: "src/html/post/post.component.html",
1514
})
1615
export class PostComponent implements OnInit, OnDestroy {
1716

0 commit comments

Comments
 (0)