Dynamically Injecting Script Tags With AngularJS

Posted by: K. Scott Allen, on 08 Apr 2014 | View original | Bookmarked: 0 time(s)

A few months ago I found myself in a situation where I had to throw some dynamically generated scripts into the browser for testing (and occasionally inspecting and debugging). I wrote a small custom directive to take care of most of the work. <div ng-controller="mainController"> <div otc-scripts scripts="scripts"> </div> </div> In the above markup, its the mainController that will fetch the script text for execution, which Ill simulate with the code below....

Category: Debugger | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1506 | Hits: 19

Similar Posts

  • Private Extension Methods more
  • Url.Action() and RouteValue Encoding more
  • Why is ASP.NET encoding &s in script URLs? A tale of looking at entirely the wrong place for a cause to a non-existing bug. more
  • Utilizing the Microsoft AJAX Framework and ClientAPI to Develop Rich Modules: Part II more
  • West Wind Ajax Toolkit updated more
  • Variable Scoping in Anonymous Delegates in C# more
  • Silverlight Browser Integration aka HTML Bridge more
  • Squeezing the last millisecond from the page load time more
  • Embedding ASP.NET Server Variables in Client JavaScript more
  • Enable the back button in ASPxGridView - Experimental more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD