Embark on your journey with gulp and angular today. Running gulp tasks to compile scss and ts files results in errors.
Error: Can't resolve all parameters for PostsComponent:
No errors occur when I compile ts using the following command:
npm run tsc:w
I've been trying to solve this issue all day without any success. It seems like the problem is related to all my services.
Take a look at my gulpfile.js below:
'use strict';
var gulp = require('gulp'),
watch = require('gulp-watch'),
prefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass'),
ts = require('gulp-typescript'),
sourcemaps = require('gulp-sourcemaps'),
cssmin = require('gulp-minify-css');
// Gulp tasks omitted for brevity
gulp.task('default', ['watch']);
This is my posts.component.ts file:
import { Component, OnInit } from "@angular/core"
import { PostsService } from "./posts.service"
import { PostItem } from "./post.item"
// Component code omitted
export class PostsComponent implements OnInit
{
// Constructor and methods omitted for brevity
}
Now let's take a look at posts.service.ts:
import { Injectable } from "@angular/core"
import { Http } from "@angular/http"
// Service code omitted
@Injectable()
export class PostsService
{
// Constructor and method omitted for brevity
}
If you have any insights or suggestions, I would greatly appreciate it. Thank you!