wikipedia viewer v2 // now with 100% more angularjs!

In this example below you will see how to do a wikipedia viewer v2 // now with 100% more angularjs! with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by fmorisan, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright fmorisan ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>wikipedia viewer v2 // now with 100% more angularjs!</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="container">
  <a ui-sref="search">Buscar</a>
  <div ui-view></div>
</div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.min.js'></script>
<script src='https://unpkg.com/angular-ui-router/release/angular-ui-router.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/fmorisan/wikipedia-viewer-v2-now-with-100-more-angularjs-VKAkOO */
.container{
  background-color: #2da;
  width: 100%;
  height: 100%;
}

.searchbox{
  position: fixed;
  top: 50%;
  margin: auto;
  border: 2px solid orange;
  border-radius: 10px;
}

/*Downloaded from https://www.codeseek.co/fmorisan/wikipedia-viewer-v2-now-with-100-more-angularjs-VKAkOO */
(
  angular.module("wikiViewer", ["ui.router"])
  
  .controller("searchCtrl", function($http, $scope, $state){
    
  })
  
  .controller("resultsCtrl", function($scope, $state){
    
  })
  
  .config(function($stateProvider, $urlRouterProvider){
    $urlRouterProvider.when("", "/");
    $stateProvider.state({
      name: "search",
      url: "/",
      controller: "searchCtrl",
      controllerAs: "Ctrl",
      template: "<div class='searchbox'> <form ng-submit='Ctrl.submit(query)'> <input type='text' ng-model='query'/> </form> </div>"
    });
    
    $stateProvider.state({
      name: "results",
      controller: "resultsCtrl",
      controllerAs: "Ctrl",
      template: "<div class='result' ng-repeat='result in results'><a href='{{result.url}}'><h3>{{result.title}}</h3><p>{{result.content}}</p></a></div>"
    });
  })
)

Comments