import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart, IPropertyPaneConfiguration, PropertyPaneToggle } from '@microsoft/sp-webpart-base'; import styles from './ToDo.module.scss'; import * as strings from 'toDoStrings'; import { IToDoWebPartProps } from './IToDoWebPartProps'; import * as angular from 'angular'; import './app/app-module'; export default class ToDoWebPart extends BaseClientSideWebPart { private $injector: angular.auto.IInjectorService; public render(): void { if (this.renderedOnce === false) { this.domElement.innerHTML = `
Loading...
{{todo.title}}
`; this.$injector = angular.bootstrap(this.domElement, ['todoapp']); } this.$injector.get('$rootScope').$broadcast('configurationChanged', { hideFinishedTasks: this.properties.hideFinishedTasks }); } protected get dataVersion(): Version { return Version.parse('1.0'); } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupName: strings.ViewGroupName, groupFields: [ PropertyPaneToggle('hideFinishedTasks', { label: strings.HideFinishedTasksFieldLabel }) ] } ] } ] }; } }