angular-jsdoc icon indicating copy to clipboard operation
angular-jsdoc copied to clipboard

angular-template update crashes js-doc

Open vpapadopou opened this issue 7 years ago • 7 comments

jsTemplate error in line 4
2 '  <ul class="chips">\r'
3 '    <% if (directiveScope) { %><li class="chip"><%= directiveScope %></li><% } %>\r'
4 '    <% var _restrict = restrict;  for(var i in _restrict) {   var rest = _restrict[i]; %><% if (restrict) { %><li class="chip"><%=rest%></li><% } %><% } %>\r'
5 '  </ul>\r'
6 '\r'
7 '  <div class="clearfix"></div>\r'
processing template: class.html
error in line 4
jsTemplate error in line 74
C:\Users\........\node_modules\angular-template\index.js:87
        throw e.raisedOnceException;
        ^

ReferenceError: restrict is not defined

After searching it seems that a recent update in angular-template leads to angular-jsdoc crashing. Reverting back to angular-template 2.1.4 solves the problem.

vpapadopou avatar Sep 28 '17 09:09 vpapadopou

+1, it's the single line treatment of ht-if and ht-repeat (<li ... ht-if="restrict" ht-repeat="rest in restrict">, class.html). Despite ht-if="restrict" is false ht-repeat-expression gets evaluated. Splitting the lists in half with ht-if in ul instead of li fixes the issue.

onkobu avatar Oct 13 '17 11:10 onkobu

You can also use this forked version that fixes the problem: https://github.com/Monsido/angular-jsdoc

vpapadopou avatar Oct 23 '17 09:10 vpapadopou

Could we get this fix in the main npm/git repo?

So we don't have to use a special "fixed" forked version.

maylortaylor avatar May 30 '18 13:05 maylortaylor

I'm still getting these error on angular-jsdoc v1.5.0, v1.4.2, and v1.4.1.

I will say that i am using "angular-jsdoc/angular-template" as my template. I know the README says that this is old and i should be using "default" instead. However, "default" does not have a Filter and is not made with Angular ... which is the name of the project... so ya.

maylortaylor avatar May 30 '18 14:05 maylortaylor

Will be this fixed? I've npm installed angular-jsdoc a couple of days ago and I'm also getting the "restrict is not defined" error.

Leprosy avatar Aug 28 '18 17:08 Leprosy

+1 waiting for a fix

luninroman avatar Aug 29 '18 12:08 luninroman

this is merged and published.

allenhwkim avatar Aug 30 '18 14:08 allenhwkim