Skip to content Skip to sidebar Skip to footer

How Do I Correctly Include "require" In My Angular 2 Project?

I am still attempting to get the angular 2 code mirror module working within my angular 2 app. I've had some import issues that I've detailed here, that I seem to have gotten past,

Solution 1:

I have solved this.

My code mirror namespace was a little out of scope.

I had it like this

map : {
    'ng2-codemirror' : 'npm:ng2-codemirror/lib'
},
packages : {
    'ng2-codemirror' : {
        main : 'index.js',
        defaultExtension: 'js'
    }
}

And I needed it to be like this

map : {
    'ng2-codemirror' : 'npm:ng2-codemirror'
},
packages : {
    'ng2-codemirror' : {
        main : 'lib/index.js',
        defaultExtension: 'js'
    }
}

I think by declaring the folder to be ng2-codemirror/lib inside the map section, I was missing out on some included dependencies or something.

Post a Comment for "How Do I Correctly Include "require" In My Angular 2 Project?"