We help IT Professionals succeed at work.

angular error

Medium Priority
176 Views
Last Modified: 2019-09-26
hi am having this error in angular
angular
Comment
Watch Question

CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Is the module inside the /app folder? If it is not you either have to move it inside the app folder or use the correct path.

Author

Commented:
hear is the model
task
leakim971Multitechnician
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
import {Task} from './task.model'

Open in new window

CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019
Commented:
In VS code if you type part of the name it will autocomplete it for you hit the Tab key and auto adds the import for you.

In your case
1. Remove the import statement from your code
2. Goto line 14 and backspace over the k in Task
3. Type k and wait for the autocomplete popup to show
4. Select Task from the list

This should add the correct import to your code.

I am guessing your path should be
import { Task } from 'src/app/tasks/task.model';

Open in new window


You are missing the 'src' bit