Reputation: 855
I'm completely new to Angular 4 and I have a task to implement reCAPTCHA. I'm following the example found on https://www.npmjs.com/package/ng-recaptcha.
In app.module.ts I've added the following:
import { RecaptchaModule } from 'ng-recaptcha';
import { RecaptchaFormsModule } from 'ng-recaptcha/forms';
In @NgModule under 'imports' I've added this:
RecaptchaModule.forRoot(),
RecaptchaFormsModule
And when I run the app, I get this error in Chrome: "index.debug.html:33 Error: Unexpected token <"
What am I missing? I'm developing with Visual Studio 2017.
Upvotes: 1
Views: 326
Reputation: 374
if ur using in visual studio that means you are using .net + angular project in your system.config.js file use this
// SystemJS config file
(function () {
System.config({
paths: {
'npm:': '/node_modules/',
},
map: {
'ng-recaptcha': 'npm:ng-recaptcha',
},
packages: {
'ng-recaptcha': { main: './index.js' },
},
});
})();
Upvotes: 2