Skip to main content
Question

Angular 4 integration for ContentExplorer

  • May 22, 2025
  • 4 replies
  • 15 views

Forum|alt.badge.img

Is there any code sample or any tutorial links for content explorer and preview for angular 4 application.

 

Thanks in Advance.

 

 

4 replies

Forum|alt.badge.img

i too am looking for this


Forum|alt.badge.img

Hey,

 

I got this working by importing the js file directly into my component 

 

import { Component, OnInit } from '@angular/core';
import '../../../box_content_explorer.js';

declare var Box: any;

@Component({
  selector: 'app-general',
  templateUrl: './general.component.html',
  styleUrls: ['./general.component.scss']
})
export class GeneralComponent implements OnInit {

  constructor() { }

  ngOnInit() {
    const contentExplorer = new Box.ContentExplorer();

    contentExplorer.show('FOLDER_ID', 'ACCESS_TOKEN', {
        container: '.container'
    });
  }
}
 
 
 
 
 
<div style="height:100vh" class="container">div>

Forum|alt.badge.img

How did you install the file locally? The NPM package requires react.

 

Edit: okay I was able to copy the file served from the cdn and paste it in locally. Though I had to use the react one. No CSS yet


Forum|alt.badge.img

We can use the CDN Links of CSS and Scripts directly in index.html
Refe this repository

https://github.com/bojjakaseenadhreddy/integrate-box-ui-elments-in-anugular