问题
I've recently updated an AngularJS project to use Protractor 2.x and wanted to take advantage of the newly embedded plugins that come along with it. I was able to activate the timeline, console, and accessibility plugins without issue, but I keep getting the below error when trying to use the ngHint plugin.
What needs to be done to include the ngHint code into a page so it can run? The Protractor plugin documentation doesn't specify to do anything besides listing the plugin in the conf.js file.
回答1:
According to the source code of the plugin, it can only mean one thing: angular.hint is not defined, which means angular-hint is not installed.
In other words, your angular application should have ngHint.js loaded.
As an example and a demo, see protractor internal tests of the error message. It throws the error message with noNgHint.html, but works with index.html (see there is angular-hint js loaded).
来源:https://stackoverflow.com/questions/30513132/nghint-plugin-cannot-be-run-as-nghint-code-was-never-included-into-the-page