{"id":4990,"date":"2020-07-06T12:44:03","date_gmt":"2020-07-06T19:44:03","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=4990"},"modified":"2020-07-06T12:44:03","modified_gmt":"2020-07-06T19:44:03","slug":"a-lap-around-microsoft-graph-toolkit-day-14-using-microsoft-graph-toolkit-with-angular","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/a-lap-around-microsoft-graph-toolkit-day-14-using-microsoft-graph-toolkit-with-angular\/","title":{"rendered":"A Lap around Microsoft Graph Toolkit Day 14 \u2013 Using Microsoft Graph Toolkit with Angular"},"content":{"rendered":"<p><strong>Author:\u00a0Cameron Dwyer<\/strong><span data-contrast=\"auto\">,\u00a0<\/span><span data-contrast=\"auto\">Microsoft\u00a0<\/span><span data-contrast=\"auto\">Office Development MVP<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/camerondwyer.com\/\"><span data-contrast=\"none\">c<\/span><span data-contrast=\"none\">amerondwyer.com<\/span><\/a><span data-contrast=\"auto\">\u00a0|\u00a0<\/span><a href=\"https:\/\/twitter.com\/CameronDwyer\"><span data-contrast=\"none\">@camerondwyer<\/span><\/a><span data-contrast=\"auto\">\u00a0|\u00a0<\/span><a href=\"https:\/\/www.linkedin.com\/in\/camerondwyer\/\"><span data-contrast=\"none\">LinkedIn<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">Introduction<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Welcome to Day 1<\/span><span data-contrast=\"auto\">4<\/span><span data-contrast=\"auto\">\u00a0of the\u00a0<\/span><a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/blogs\/announcing-a-lap-around-microsoft-graph-toolkit-blog-series\/\"><span data-contrast=\"none\">Microsoft Graph Toolkit blog series!<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">In the series so\u00a0<\/span><span data-contrast=\"auto\">far,<\/span><span data-contrast=\"auto\">\u00a0we have\u00a0<\/span><span data-contrast=\"auto\">exercised<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">the Microsoft Graph Toolkit\u00a0<\/span><span data-contrast=\"auto\">capabilities\u00a0<\/span><span data-contrast=\"auto\">using<\/span><span data-contrast=\"auto\">\u00a0plain<\/span><span data-contrast=\"auto\">\u00a0JavaScript\/HTML\/CSS<\/span><span data-contrast=\"auto\">\u00a0which<\/span><span data-contrast=\"auto\">\u00a0has shown\u00a0<\/span><span data-contrast=\"auto\">that we are not<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">dependent upon<\/span><span data-contrast=\"auto\">\u00a0any\u00a0<\/span><span data-contrast=\"auto\">specific\u00a0<\/span><span data-contrast=\"auto\">JavaScript framework<\/span><span data-contrast=\"auto\">.\u00a0<\/span><span data-contrast=\"auto\">In\u00a0<\/span><span data-contrast=\"auto\">a\u00a0<\/span><span data-contrast=\"auto\">real-world<\/span><span data-contrast=\"auto\">\u00a0application however<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\">\u00a0you\u00a0<\/span><span data-contrast=\"auto\">may<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">be<\/span><span data-contrast=\"auto\">\u00a0us<\/span><span data-contrast=\"auto\">ing<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">a full<\/span><span data-contrast=\"auto\">&#8211;<\/span><span data-contrast=\"auto\">feature<\/span><span data-contrast=\"auto\">d<\/span><span data-contrast=\"auto\">\u00a0JavaScript framework such as React or Angular.\u00a0<\/span><span data-contrast=\"auto\">In the previous article\u00a0<\/span><a href=\"https:\/\/twitter.com\/franzinifabio\"><span data-contrast=\"none\">Fabio Franzini<\/span><\/a><span data-contrast=\"auto\">\u00a0took us through\u00a0<\/span><span data-contrast=\"auto\">using the Microsoft Graph Toolkit in a React<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">application<\/span><span data-contrast=\"auto\">.\u00a0<\/span><span data-contrast=\"auto\">Today\u00a0<\/span><span data-contrast=\"auto\">I\u2019m going to take you through constructing the same\u00a0<\/span><span data-contrast=\"auto\">example using\u00a0<\/span><a href=\"https:\/\/angular.io\/\"><span data-contrast=\"none\">Angular<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">Creating a\u00a0<\/span><span data-contrast=\"none\">w<\/span><span data-contrast=\"none\">eb\u00a0<\/span><span data-contrast=\"none\">a<\/span><span data-contrast=\"none\">pp\u00a0<\/span><span data-contrast=\"none\">using the<\/span><span data-contrast=\"none\">\u00a0Angular<\/span><span data-contrast=\"none\">\u00a0CLI<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">One of the great benefits of using a JavaScript framework like Angular is that you can scaffold<\/span><span data-contrast=\"auto\">\u00a0a new application very quickly<\/span><span data-contrast=\"auto\">. This scaffolding includes not only the\u00a0<\/span><span data-contrast=\"auto\">source\u00a0<\/span><span data-contrast=\"auto\">code\u00a0<\/span><span data-contrast=\"auto\">for a default app, but also an entire\u00a0<\/span><span data-contrast=\"auto\">development, testing, and packaging\u00a0<\/span><span data-contrast=\"auto\">toolchain<\/span><span data-contrast=\"auto\">.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">W<\/span><span data-contrast=\"auto\">e make use of the\u00a0<\/span><a href=\"https:\/\/angular.io\/cli\"><span data-contrast=\"none\">Angular CLI<\/span><\/a><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">to scaffold up our new application. If\u00a0<\/span><span data-contrast=\"auto\">you have<\/span><span data-contrast=\"auto\">\u00a0never used the Angular CLI before\u00a0<\/span><span data-contrast=\"auto\">you can install it by executing the following command.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">npm\u00a0install -g @angular\/cli<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Angular CLI command<\/span><span data-contrast=\"auto\">s<\/span><span data-contrast=\"auto\">\u00a0begin with\u00a0<\/span><b><span data-contrast=\"auto\">ng<\/span><\/b><span data-contrast=\"auto\">,\u00a0<\/span><span data-contrast=\"auto\">and\u00a0<\/span><span data-contrast=\"auto\">we can create\u00a0<\/span><span data-contrast=\"auto\">a new application with the command<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">ng new demo-mgt-angular<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-4993\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image001-300x95.png\" alt=\"Creating the Angular project in terminal\" width=\"673\" height=\"213\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image001-300x95.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image001-1024x323.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image001-768x242.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image001-1536x485.png 1536w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image001.png 1778w\" sizes=\"(max-width: 673px) 100vw, 673px\" \/><\/p>\n<p><span data-contrast=\"auto\">Opening the resulting folder in\u00a0<\/span><span data-contrast=\"auto\">VS<\/span><span data-contrast=\"auto\">\u00a0Code will reveal the default Angular project<\/span><span data-contrast=\"auto\">. The README.MD file provides instructions on how to\u00a0<\/span><span data-contrast=\"auto\">work with this default project.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">To build and\u00a0<\/span><span data-contrast=\"auto\">debug<\/span><span data-contrast=\"auto\">\u00a0our new app locally<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">we\u00a0<\/span><span data-contrast=\"auto\">can\u00a0<\/span><span data-contrast=\"auto\">use the following command<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">n<\/span><\/b><b><span data-contrast=\"auto\">g\u00a0<\/span><\/b><b><span data-contrast=\"auto\">serve<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">This will<\/span><span data-contrast=\"auto\">\u00a0host<\/span><span data-contrast=\"auto\">\u00a0the app\u00a0<\/span><span data-contrast=\"auto\">on a local dev server at\u00a0<\/span><a href=\"http:\/\/localhost:4200\/\"><span data-contrast=\"none\">http:\/\/localhost:4200<\/span><\/a><span data-contrast=\"auto\">, when opened in a browser we are presented\u00a0<\/span><span data-contrast=\"auto\">with the default Angular CLI\u00a0<\/span><span data-contrast=\"auto\">app.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-4996\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image004-300x123.jpg\" alt=\"Default Angular app running in the browser\" width=\"650\" height=\"267\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image004-300x123.jpg 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image004.jpg 602w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<h3><span data-contrast=\"none\">Adding<\/span><span data-contrast=\"none\">\u00a0the Microsoft Graph Toolkit<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Time to make some changes to this default app and bring in the Microsoft Graph Toolkit.\u00a0<\/span><span data-contrast=\"auto\">First,<\/span><span data-contrast=\"auto\">\u00a0we need to allow Angular to use<\/span><span data-contrast=\"auto\">\u00a0w<\/span><span data-contrast=\"auto\">eb\u00a0<\/span><span data-contrast=\"auto\">c<\/span><span data-contrast=\"auto\">omponents by adding the\u00a0<\/span><b><span data-contrast=\"auto\">CUSTOM_ELEMENTS_SCHEMA<\/span><\/b><span data-contrast=\"auto\">\u00a0to the\u00a0<\/span><b><span data-contrast=\"auto\">app module<\/span><\/b><span data-contrast=\"auto\">.<\/span><span data-contrast=\"auto\">\u00a0This is because the element names\u00a0<\/span><span data-contrast=\"auto\">used by the web component<\/span><span data-contrast=\"auto\">s<\/span><span data-contrast=\"auto\">\u00a0are not the standard HTML element names and TypeScript\u00a0<\/span><span data-contrast=\"auto\">will not<\/span><span data-contrast=\"auto\">\u00a0be able to validate them.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-4997\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image005-300x203.png\" alt=\"Add the CUSTOM_ELEMENTS_SCHEMA to the app module\" width=\"598\" height=\"405\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image005-300x203.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image005-1024x692.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image005-768x519.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image005.png 1185w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/p>\n<p><span data-contrast=\"auto\">Next,<\/span><span data-contrast=\"auto\">\u00a0we need to get the Microsoft Graph Toolkit NPM package and add it to our app<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">npm\u00a0install @microsoft\/mgt<\/span><\/b><b><span data-contrast=\"auto\">\u00a0&#8211;save<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The first component we will add is the\u00a0<\/span><b><span data-contrast=\"auto\">MsalProvider<\/span><\/b><span data-contrast=\"auto\">\u00a0since it is fundamental to\u00a0<\/span><span data-contrast=\"auto\">enable<\/span><span data-contrast=\"auto\">\u00a0the other\u00a0<\/span><span data-contrast=\"auto\">toolkit\u00a0<\/span><span data-contrast=\"auto\">components<\/span><span data-contrast=\"auto\">\u00a0to function<\/span><span data-contrast=\"auto\">. We import\u00a0<\/span><b><span data-contrast=\"auto\">Providers<\/span><\/b><span data-contrast=\"auto\">\u00a0and\u00a0<\/span><b><span data-contrast=\"auto\">MsalProv<\/span><\/b><b><span data-contrast=\"auto\">ider<\/span><\/b><span data-contrast=\"auto\">, then\u00a0<\/span><span data-contrast=\"auto\">when our app\u00a0<\/span><span data-contrast=\"auto\">initializes<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">set the\u00a0<\/span><span data-contrast=\"auto\">MsalProvider<\/span><span data-contrast=\"auto\">\u00a0in code<\/span><span data-contrast=\"auto\">, using the client id\u00a0<\/span><span data-contrast=\"auto\">of our\u00a0<\/span><span data-contrast=\"auto\">Azure App\u00a0<\/span><span data-contrast=\"auto\">Registration<\/span><span data-contrast=\"auto\">\u00a0(<\/span><a href=\"https:\/\/developer.microsoft.com\/en-us\/microsoft-365\/blogs\/a-lap-around-microsoft-graph-toolkit-day-2-zero-to-hero\/\"><span data-contrast=\"none\">creation of App Registration is covered in Day 2 of this series<\/span><\/a><span data-contrast=\"auto\">)<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-4999\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image007-300x153.png\" alt=\"Add MSAL provider to app component file\" width=\"650\" height=\"332\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image007-300x153.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image007-1024x524.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image007-768x393.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image007.png 1408w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<h3><span data-contrast=\"none\">Adding the<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">mgt-l<\/span><span data-contrast=\"none\">ogin\u00a0<\/span><span data-contrast=\"none\">c<\/span><span data-contrast=\"none\">omponent<\/span><span data-contrast=\"none\">\u00a0to the navigation bar<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Let\u2019s<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">create\u00a0<\/span><span data-contrast=\"auto\">the<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">Angular\u00a0<\/span><span data-contrast=\"auto\">NavBar\u00a0component that will sit along the top of our app and contain the\u00a0<\/span><span data-contrast=\"auto\">mgt-login<\/span><span data-contrast=\"auto\">\u00a0component<\/span><span data-contrast=\"auto\">.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">W<\/span><span data-contrast=\"auto\">e can create the\u00a0NavBar\u00a0component using the Angular CLI<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">ng\u00a0generate\u00a0component\u00a0NavBar<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Replace<\/span><span data-contrast=\"auto\">\u00a0the<\/span><span data-contrast=\"auto\">\u00a0default app component\u00a0<\/span><span data-contrast=\"auto\">HTML<\/span><span data-contrast=\"auto\">\u00a0template\u00a0<\/span><span data-contrast=\"auto\">to<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">just<\/span><span data-contrast=\"auto\">\u00a0show the\u00a0NavBar\u00a0component<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5001\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image009-300x55.png\" alt=\"Replace the default app component HTML template to just show the NavBar component \" width=\"365\" height=\"67\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image009-300x55.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image009.png 710w\" sizes=\"(max-width: 365px) 100vw, 365px\" \/><\/p>\n<p><span class=\"TextRun SCXW58370616 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW58370616 BCX0\">Now we can simply add the mgt-login\u00a0<\/span><\/span><span class=\"TextRun SCXW58370616 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW58370616 BCX0\">web\u00a0<\/span><\/span><span class=\"TextRun SCXW58370616 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW58370616 BCX0\">component to the\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2 SpellingErrorHighlight SCXW58370616 BCX0\">NavBar<\/span><span class=\"NormalTextRun SCXW58370616 BCX0\">\u00a0<\/span><\/span><span class=\"TextRun SCXW58370616 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW58370616 BCX0\">HTML\u00a0<\/span><\/span><span class=\"TextRun SCXW58370616 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW58370616 BCX0\">template<\/span><\/span><span class=\"TextRun SCXW58370616 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW58370616 BCX0\">.<\/span><\/span><span class=\"EOP SCXW58370616 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5003\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image011-300x65.png\" alt=\"Add the mgt-login web component to the NavBar HTML template\" width=\"600\" height=\"130\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image011-300x65.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image011-1024x223.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image011-768x167.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image011.png 1231w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><span class=\"TextRun SCXW116747587 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW116747587 BCX0\">At this stage we have successfully integrated the Graph Toolkit into our Angular app and the\u00a0<\/span><\/span><span class=\"TextRun SCXW116747587 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW116747587 BCX0\">mgt-<\/span><\/span><span class=\"TextRun SCXW116747587 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW116747587 BCX0\">login component is fully functional<\/span><\/span><span class=\"TextRun SCXW116747587 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW116747587 BCX0\">.<\/span><\/span><span class=\"EOP SCXW116747587 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5005\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image013-300x101.png\" alt=\"Web page title and mgt-login component shown in web browser\" width=\"487\" height=\"164\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image013-300x101.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image013.png 631w\" sizes=\"(max-width: 487px) 100vw, 487px\" \/><\/p>\n<h3><span data-contrast=\"none\">Adding\u00a0<\/span><span data-contrast=\"none\">the\u00a0<\/span><span data-contrast=\"none\">mgt-a<\/span><span data-contrast=\"none\">genda\u00a0<\/span><span data-contrast=\"none\">c<\/span><span data-contrast=\"none\">o<\/span><span data-contrast=\"none\">mponent<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Now let\u2019s create a new Angular component called\u00a0AngularAgenda\u00a0<\/span><span data-contrast=\"auto\">using the CLI<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">and bring the mgt-agenda component into it.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">ng\u00a0generate\u00a0component\u00a0AngularAgenda<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Then<\/span><span data-contrast=\"auto\">\u00a0add\u00a0<\/span><span data-contrast=\"auto\">AngularAgenda\u00a0<\/span><span data-contrast=\"auto\">to our app component\u00a0<\/span><span data-contrast=\"auto\">HTML\u00a0<\/span><span data-contrast=\"auto\">template<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5007\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image015-300x87.png\" alt=\"add AngularAgenda to our app component HTML template \" width=\"425\" height=\"123\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image015-300x87.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image015-768x222.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image015.png 832w\" sizes=\"(max-width: 425px) 100vw, 425px\" \/><\/p>\n<p><span class=\"TextRun SCXW196259075 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW196259075 BCX0\">Now we can simply add the mgt-agenda\u00a0<\/span><\/span><span class=\"TextRun SCXW196259075 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW196259075 BCX0\">web\u00a0<\/span><\/span><span class=\"TextRun SCXW196259075 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW196259075 BCX0\">component\u00a0<\/span><\/span><span class=\"TextRun SCXW196259075 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW196259075 BCX0\">to the\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2 SpellingErrorHighlight SCXW196259075 BCX0\">AngularAgenda<\/span><span class=\"NormalTextRun SCXW196259075 BCX0\"> HTML template<\/span><\/span><\/p>\n<p><span class=\"EOP SCXW196259075 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span> <img decoding=\"async\" class=\"alignnone wp-image-5009\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image017-300x87.png\" alt=\"add the mgt-agenda web component to the AngularAgenda HTML template \" width=\"486\" height=\"141\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image017-300x87.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image017-768x222.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image017.png 863w\" sizes=\"(max-width: 486px) 100vw, 486px\" \/><\/p>\n<p><span class=\"TextRun SCXW9271234 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW9271234 BCX0\">This is enough to have a fully functional\u00a0<\/span><\/span><span class=\"TextRun SCXW9271234 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW9271234 BCX0\">mgt-<\/span><\/span><span class=\"TextRun SCXW9271234 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW9271234 BCX0\">agenda displayed for the current user<\/span><\/span><span class=\"EOP SCXW9271234 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5011\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image019-300x240.png\" alt=\"Fully functional mgt-agenda displayed for the current user \" width=\"505\" height=\"404\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image019-300x240.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image019.png 722w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/p>\n<h3><span data-contrast=\"none\">Implementing a\u00a0<\/span><span data-contrast=\"none\">c<\/span><span data-contrast=\"none\">ustom\u00a0<\/span><span data-contrast=\"none\">t<\/span><span data-contrast=\"none\">emplate for\u00a0<\/span><span data-contrast=\"none\">mgt-agenda<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Let\u2019s take this a step further and see how we can provide a custom template for rendering each of the agenda items.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">If we look at the documentation for the\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/toolkit\/templates\"><span data-contrast=\"none\">Microsoft Graph Toolkit and custom templat<\/span><span data-contrast=\"none\">ing<\/span><\/a><span data-contrast=\"auto\">\u00a0we discover that the syntax for referring to the property data for each of the returned items is to use double braces as shown below.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5013\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image021-300x171.png\" alt=\"syntax for referring to the property data for each of the returned items is to use double braces\" width=\"515\" height=\"294\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image021-300x171.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image021-768x437.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image021.png 959w\" sizes=\"(max-width: 515px) 100vw, 515px\" \/><\/p>\n<p><span class=\"TextRun SCXW250907467 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW250907467 BCX0\">This conflicts with Angular as\u00a0<\/span><\/span><span class=\"TextRun SCXW250907467 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW250907467 BCX0\">double braces<\/span><\/span><span class=\"TextRun SCXW250907467 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW250907467 BCX0\">\u00a0<\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2 SCXW250907467 BCX0\">is<\/span><span class=\"NormalTextRun SCXW250907467 BCX0\"> the exact syntax that Angular databinding uses! The Angular compiler will not be happy.<\/span><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5015\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image023-300x59.png\" alt=\"Error in terminal for using double braces\" width=\"650\" height=\"127\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image023-300x59.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image023-1024x200.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image023-768x150.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image023-1536x300.png 1536w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image023.png 1986w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<p><span data-contrast=\"auto\">Luckily,<\/span><span data-contrast=\"auto\">\u00a0the Graph Toolkit is flexible with its syntax and we can change the characters it uses for binding using the\u00a0<\/span><b><span data-contrast=\"auto\">TemplateHelper<\/span><\/b><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">We will do this once in our\u00a0<\/span><span data-contrast=\"auto\">top-level<\/span><span data-contrast=\"auto\">\u00a0App component so that it applies globally.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5017\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image025-300x163.png\" alt=\"Add TemplateHelper in top-level App component\" width=\"650\" height=\"353\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image025-300x163.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image025-1024x555.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image025-768x417.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image025.png 1392w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<p><span class=\"TextRun SCXW248506049 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW248506049 BCX0\">Now we can use our custom binding syntax to avoid the conflict and Angular is happy again.<\/span><\/span><span class=\"EOP SCXW248506049 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5019\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image027-300x170.png\" alt=\"Use custom binding syntax to avoid the conflict\" width=\"464\" height=\"263\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image027-300x170.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image027-768x436.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image027.png 847w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><\/p>\n<p><span data-contrast=\"auto\">We will implement the same custom template\u00a0<\/span><span data-contrast=\"auto\">as\u00a0<\/span><span data-contrast=\"auto\">used in the React sample<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"none\">(taken from the post:\u202f<\/span><a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/blogs\/a-lap-around-microsoft-graph-toolkit-day-5-customizing-components-using-templates\/\"><span data-contrast=\"none\">A Lap around Microsoft Graph Toolkit Day 5 &#8211; Customizing Components using Templates<\/span><\/a><span data-contrast=\"none\">)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Firstly we\u00a0<\/span><span data-contrast=\"auto\">will specify the\u00a0<\/span><span data-contrast=\"auto\">custom<\/span><span data-contrast=\"auto\">\u00a0template<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">using<\/span><span data-contrast=\"auto\">\u00a0<\/span><b><span data-contrast=\"auto\">data-props<\/span><\/b><span data-contrast=\"auto\">\u00a0and\u00a0<\/span><b><span data-contrast=\"auto\">data-if<\/span><\/b><span data-contrast=\"auto\">\u00a0attributes to bind\u00a0<\/span><span data-contrast=\"auto\">to mgt-agenda event data<\/span><span data-contrast=\"auto\">. You\u2019ll also notice we are calling\u00a0<\/span><span data-contrast=\"auto\">custom methods (openWebLink, getTime, getDate)<\/span><span data-contrast=\"auto\">\u00a0within the custom template. We need to define those methods and make them available to the mgt-agenda component<\/span><span data-contrast=\"auto\">, to do this we will need to get a handle directly on the\u00a0<\/span><span data-contrast=\"auto\">instance of the mgt-agenda element\u00a0<\/span><span data-contrast=\"auto\">after it is created in the DOM<\/span><span data-contrast=\"auto\">.\u00a0<\/span><span data-contrast=\"auto\">Using<\/span><span data-contrast=\"auto\">\u00a0the\u00a0<\/span><b><span data-contrast=\"auto\">#myagenda<\/span><\/b><span data-contrast=\"auto\">\u00a0template\u00a0<\/span><span data-contrast=\"auto\">reference variable<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">will allow us to easily make that connection.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5021\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image029-300x85.png\" alt=\"Use the #myagenda template reference variable\" width=\"650\" height=\"184\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image029-300x85.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image029-1024x290.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image029-768x218.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image029.png 1249w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<p><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">In our code for the\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2 BCX0 SCXW227853987\">AngularAgenda<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0component\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">we can now use the\u00a0<\/span><\/span><strong><span class=\"TextRun MacChromeBold BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">@ViewChild<\/span><\/span><\/strong><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0property decorator to\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">return a handle on the mgt-agenda element after it<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0has been<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0created in the DOM<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">and add our custom methods\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">to the template context<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0(<\/span><\/span><strong><span class=\"TextRun MacChromeBold BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2 BCX0 SCXW227853987\">agendaElement.nativeElement.templateContext<\/span><\/span><\/strong><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">)<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">.<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0Note\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">we<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0must\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">specify\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">the<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0<\/span><\/span><strong><span class=\"TextRun MacChromeBold BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">@ViewChild<\/span><\/span><\/strong><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">metadata property\u00a0<\/span><\/span><span class=\"TextRun MacChromeBold BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">static<\/span><\/span><span class=\"TextRun MacChromeBold BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">with value<\/span><\/span><span class=\"TextRun MacChromeBold BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0true<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0to<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">make Angular return the handle to\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">#myagenda\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">in\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">the\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2 BCX0 SpellingErrorHighlight SCXW227853987\">ngOnInit<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0lifecycle hook (<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">by default it is not available until\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2 BCX0 SCXW227853987\">ngAfterViewInit<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">\u00a0which is too late to apply the\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2 BCX0 DefaultHighlightTransition SCXW227853987\">templ<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2 BCX0 DefaultHighlightTransition SCXW227853987\">at<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2 BCX0 DefaultHighlightTransition SCXW227853987\">eContext<\/span><\/span><span class=\"TextRun BCX0 SCXW227853987\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW227853987\">).<\/span><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5023\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image031-300x203.png\" alt=\"Use @ViewChild property decorator to return a handle on the mgt-agenda element for AngularAgenda component \" width=\"650\" height=\"439\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image031-300x203.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image031-1024x692.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image031-768x519.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image031.png 1026w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<p><span class=\"TextRun SCXW237376643 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW237376643 BCX0\">With a little\u00a0<\/span><\/span><span class=\"TextRun SCXW237376643 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW237376643 BCX0\">bit of styling added our demo app is now complete<\/span><\/span><span class=\"TextRun SCXW237376643 BCX0\" lang=\"EN-AU\" xml:lang=\"EN-AU\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW237376643 BCX0\">!<\/span><\/span><span class=\"EOP SCXW237376643 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5025\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image033-300x188.png\" alt=\"Demo app completed and running in browser\" width=\"650\" height=\"408\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image033-300x188.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image033-768x482.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/07\/image033.png 927w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<p><span data-contrast=\"auto\">T<\/span><span data-contrast=\"auto\">he source code for this\u00a0<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/mgtLap-TryItOut\/tree\/master\/14%20-%20Angular%20App\"><span data-contrast=\"none\">Angular sample\u00a0<\/span><span data-contrast=\"none\">is available in GitHub<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">To Summarize<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">We have<\/span><span data-contrast=\"auto\">\u00a0seen\u00a0<\/span><span data-contrast=\"auto\">how we can take our learning<\/span><span data-contrast=\"auto\">s<\/span><span data-contrast=\"auto\">\u00a0so\u00a0<\/span><span data-contrast=\"auto\">far\u00a0<\/span><span data-contrast=\"auto\">in<\/span><span data-contrast=\"auto\">\u00a0this series with the Microsoft Gra<\/span><span data-contrast=\"auto\">p<\/span><span data-contrast=\"auto\">h Toolkit and then\u00a0<\/span><span data-contrast=\"auto\">apply<\/span><span data-contrast=\"auto\">\u00a0it\u00a0<\/span><span data-contrast=\"auto\">to<\/span><span data-contrast=\"auto\">\u00a0a\u00a0<\/span><span data-contrast=\"auto\">real-world<\/span><span data-contrast=\"auto\">\u00a0Angular application<\/span><span data-contrast=\"auto\">\u00a0by:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"0\" data-aria-level=\"1\"><span data-contrast=\"auto\">Creating an Angular application using the Angular CLI<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"0\" data-aria-level=\"1\"><span data-contrast=\"auto\">Adding the Microsoft Graph Toolkit\u00a0<\/span><span data-contrast=\"auto\">NPM<\/span><span data-contrast=\"auto\">\u00a0package<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"0\" data-aria-level=\"1\"><span data-contrast=\"auto\">Configuring the\u00a0MsalProvider<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"0\" data-aria-level=\"1\"><span data-contrast=\"auto\">Using\u00a0<\/span><span data-contrast=\"auto\">mgt-login and mgt-agenda web component within Angular components<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"0\" data-aria-level=\"1\"><span data-contrast=\"auto\">Specifying custom templates for the mgt-agenda component\u00a0<\/span><span data-contrast=\"auto\">including property and event binding<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">We have<\/span><span data-contrast=\"auto\">\u00a0almost completed our lap<\/span><span data-contrast=\"auto\">, and as we round the final\u00a0<\/span><span data-contrast=\"auto\">bend,<\/span><span data-contrast=\"auto\">\u00a0I hope\u00a0<\/span><span data-contrast=\"auto\">you have<\/span><span data-contrast=\"auto\">\u00a0progressed with us from\u00a0<\/span><span data-contrast=\"auto\">zero to hero<\/span><span data-contrast=\"auto\">\ufe0f<\/span><span data-contrast=\"auto\">.\u00a0<\/span><span data-contrast=\"auto\">Stay tuned for our final article as we wrap it all up<\/span><span data-contrast=\"auto\">!<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In day 14 of A Lap around Microsoft Graph Toolkit, we will show you how to add toolkit components in your Angular projects from creating an Angular project to adding custom templating!<\/p>\n","protected":false},"author":69099,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[34],"class_list":["post-4990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","tag-microsoft-graph-toolkit"],"acf":[],"blog_post_summary":"<p>In day 14 of A Lap around Microsoft Graph Toolkit, we will show you how to add toolkit components in your Angular projects from creating an Angular project to adding custom templating!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/4990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69099"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=4990"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/4990\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=4990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=4990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=4990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}