Search Posts

Category: pug

ngRoute loads only template on refresh

I have a project using nodejs with express & pug in the backend, and AngularJS with ngroute on the frontend. The way it used to work was: I enter website, it loads index.html (with angular stuff) and then /home(with content created with pug) as a view. When i choose to enter another document, angular requests it from express, and server fills it with pug (eg. /users), angular loads it into view leaving menu,etc. untouched It […]

how to make one ng-repeat to work on different columns in different rows

I am trying to display data formulated like this using angular “a”:[{ “name”: “a’s name” “b”:[{ “name”:”b’s name” “c”:[{ “name”: “c’s name” “d”:[{ “name”:”d’s name” }] }] }] }] and i tried this but it couldn’t work tr td(ng-repeat=”oneB in a.b”) | {{oneB.name}} tr td(ng-repeat=”oneC in oneB.c”) | {{oneC.name}} tr td(ng-repeat=”oneD in oneC.d”) | {{oneD.name}} and also this tr td(ng-repeat-start=”oneB in a.b”) | {{oneB.name}} tr td(ng-repeat-end,ng-repeat-start=”oneC in oneB.c”) | {{oneC.name}} tr td(ng-repeat-end,ng-repeat=”oneD in oneC.d”) | […]

unable to load dynamic page in view only mode based on condition

In jade file, on particular condition i need to make the field in view only mode. but when i give the condition ng-class=”details.lockedStatus.isLocked ? ‘view’ : ‘editView’” . The page is not fully rendered…… form(name=”mainForm” class=”form-horizontal” ng-class=”details.lockedStatus.isLocked ? ‘view’ : ‘editView'”) md-content(style=””) md-tabs(md-dynamic-height=”, md-border-bottom=”) md-tab(label=’Project Details’) md-content.md-padding h1.md-display-2(style=”color:#315a8e”) Project Infomation md-content(md-theme=’docs-dark’, style=”font-size: 16px; width: 99%;” layout-padding=” class=”border”) div(ng-repeat=”p in details.project_details” class=”col-md-3″ style=”margin-top:10px; margin-top: 10px; float: left;”) md-input-container(style=”” ng-if=”p.type == ‘text'” class=”col-md-12″) label {{p.label}} <span style=”color:#ff0000″ […]

ng repeat json parse show empty string

I had the array of objects string from a list of array. I convert object string to object using method of JSON.parse the object but it shows empty within ng-repeat. Jade .item.col-md-4(ng-repeat=’p in searchData | filter: paginate | orderBy: sortKey ‘) // `p` is a object of string, for example “{id:2, name:’abel’}”; – var property = JSON.parse(“{{ p }}”); // Error at this line +AddPropertyCard(property) Error var property = JSON.parse(“”); Unexpected token { in JSON […]