T
T
TEugene_122018-11-24 12:24:57
Angular
TEugene_12, 2018-11-24 12:24:57

How to display data in Pug from Angular?

Hi all.
There is a template on Pug

doctype html
html(ng-app='app')
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
    script(src='https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js')
    script(src='/angular/p.js')
  body(ng-controller='cont')
    block content    
    h1(ng-repeat='v in data.vals') {{v}}

And p.js
angular.module('app',[]);

angular.module('app').controller('cont', function($scope) {
    $scope.data = {
        vals: [ '1', '2', '3' ];
    };
});

Why am I getting this result?
5bf9184f12249922744159.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question