String.prototype.startsWith:“undefined不是构造函数”,PhantomCss是phantomjs无法处理使用角度ui-view的应用程序

时间:2017-09-01 10:16:26

标签: angularjs phantomcss

当我使用如下时,ui-view元素不会出现:

casper.start('https://carepilot-web-staging.herokuapp.com/login');
casper.then( function () {
            require('utils').dump(this.getElementInfo('.main-page'));
            phantomcss.screenshot( '.loginWrapper', 'Get login page' );
            this.echo('get login page...');
        } );

要求打印出div null

<div ui-view=\"\" class=\"main-page ng-scope\"></div>

它应该是:

<div ui-view="" class="main-page ng-scope" style="">
<div class="loginWrapper ng-scope" ng-controller="loginController as vm">
    <div class="login-panel">
        <div login-form="" ng-hide="vm.showForgotPassword || vm.showTOU"><form name="vm.loginForm" ng-submit="vm.login()" class="ng-pristine ng-valid-email ng-invalid ng-invalid-required" style="">
    <div class="panel-fields">
        <div class="logo icon-logo"></div>
        <div>
            <input type="email" name="username" id="username" class="form-control ng-pristine ng-untouched ng-empty ng-valid-email ng-invalid ng-invalid-required" ng-model="vm.username" placeholder="Email" required="" ng-class="{'error': vm.loginError &amp;&amp; username.$pristine}" style="">
            <!-- ngIf: vm.loginError -->
        </div>
        <div>
            <input type="password" name="password" id="password" class="form-control ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required" ng-model="vm.password" placeholder="Password" required="" ng-class="{'error': vm.loginError &amp;&amp; password.$pristine}" style="">
            <!-- ngIf: vm.loginError -->
        </div>
        <div ng-show="vm.resetEmail" class="ng-binding ng-hide" style="">Reset Password email has been sent to </div>
    </div>

    <div class="panel-buttons">

        <button id="loginButton" type="submit" class="btn-login ng-binding ng-hide-remove" ng-show="!vm.loginError || vm.loginForm.$dirty" ng-class="{ 'btn-login-green' : vm.loginForm.$valid }">Login</button>
        <button id="errorButton" class="btn-login btn-login-red ng-hide" ng-show="vm.loginError &amp;&amp; !vm.loginForm.$dirty" disabled="disabled" style="">
            <div class="ng-binding">SORRY</div>
            <div class="ng-binding">We didn't recognize that email and password</div>
        </button>
        <button id="forgotPwdButton" type="button" class="btn-login btn-clear ng-binding" ng-click="vm.showForgotPassword=true">I forgot my password</button>
    </div>
</form>
</div>
</div>
</div>

我尝试了一天没有成功,有人能给我一些建议吗?谢谢!

编辑:

细节是: **Error: undefined is not a constructor (evaluating 'config.url.startsWith('api/CarePilot/')') request@https://carepilot-web-staging.herokuapp.com/config.js:71:42 More info: [ { "file": "https://carepilot-web-staging.herokuapp.com/bower_components/angular.js", "line": 14199, "function": "" } ] Broken interceptor detected: Config object not supplied in rejection: https://github.com/chieffancypants/angular-loading-bar/pull/50 配置行71是if (config.url.startsWith('api/CarePilot/')) {

我将其更改为if (_.startsWith(config.url,'api/CarePilot/')) {,没关系。

0 个答案:

没有答案