make simple menu navigation bootstrap

New Contributor

I'm newbie and I want to create web part have menu navigation bootstrap,in my code I just read all pages and plus html element but nothing happen with 'let html' variables, below is my code


private _getallpage():void {

    let html:string = `<nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
            <a class="navbar-brand" href="#">WebSiteName</a>
        <ul class="nav navbar-nav">`;
    const element:Element = this.domElement.querySelector("#webinfo");
    const w = new Web("");

        .select("Title", "FileRef", "FieldValuesAsText/MetaInfo")
        .get().then(r => {

            for (var i = 0; i < r.length; i++) {
                html +=`<li><a href="#">` + r[i].Title + `</a></li>`;

            html += `</ul></div></nav>`;
    }).catch(e => { console.error(e); });

    element.innerHTML = html;







0 Replies